Macaulay2 Engine
Loading...
Searching...
No Matches
ARingRRTest.cpp File Reference

gtest coverage for the 53-bit double-backed M2::ARingRR real-number aring. More...

#include <cstdio>
#include <string>
#include <iostream>
#include <sstream>
#include <memory>
#include <gtest/gtest.h>
#include <mpfr.h>
#include "aring-RR.hpp"
#include "ARingTest.hpp"

Go to the source code of this file.

Functions

bool almostEqual (const M2::ARingRR &R, unsigned long nbits, const M2::ARingRR::ElementType &a, const M2::ARingRR::ElementType &b)
template<>
void getElement< M2::ARingRR > (const M2::ARingRR &R, int index, M2::ARingRR::ElementType &result)
 TEST (ARingRR, create)
void testRingNegateRR (const M2::ARingRR &R, int ntrials)
 TEST (ARingRR, negate)
 TEST (ARingRR, add)
 TEST (ARingRR, subtract)
 TEST (ARingRR, multDivide)
 TEST (ARingRR, axioms)
 TEST (ARingRR, power_and_invert)

Detailed Description

gtest coverage for the 53-bit double-backed M2::ARingRR real-number aring.

Note
AI-generated documentation. Verify against the source before relying on it.

Plugs M2::ARingRR into the ARingTest.hpp harness, defines the per-backend almostEqual(R, nbits, a, b) epsilon checker the floating-point tests use in place of exact equality, and provides the getElement<M2::ARingRR> specialisation that feeds the shared testSomeMore driver with deterministic edge-case prefix elements (zero, plus/minus one, near-overflow exponents) followed by random doubles. The almostEqual helper scales 2^-nbits to match each test's expected propagation of round-off; arithmetic tests use ~50 bits, iterated sqrt / pow round-trips loosen the tolerance as needed.

Sibling files ARingRRRTest.cpp, ARingRRiTest.cpp, ARingCCTest.cpp, and ARingCCCTest.cpp (covered by the same file-aring-real-complex-tests markdown) follow the same template against MPFR / MPFI / complex<double> / MPC backends, including the cross-backend agreement check that ARingRRR at 53 bits stays within 2^-50 of ARingRR.

See also
ARingTest.hpp
aring-RR.hpp
ARingRRRTest.cpp
ARingRRiTest.cpp
ARingCCTest.cpp

Definition in file ARingRRTest.cpp.