Average Error: 43.3 → 9.7
Time: 12.5s
Precision: binary64
\[\]
\[\]
double code(double x, double l, double t) {
	return (sqrt(2.0) * t) / sqrt((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l));
}
double code(double x, double l, double t) {
	double tmp;
	if (t <= -8.77596588101209e+129) {
		tmp = (t * sqrt(2.0)) / ((2.0 * (t / (2.0 * (x * (sqrt(2.0) * x))))) - ((t * sqrt(2.0)) + ((t / sqrt(2.0)) * ((2.0 / x) + (2.0 / (x * x))))));
	} else if ((t <= 3.4253329703721362e-276) || (!(t <= 1.951729093596874e-167) && (t <= 2.2489208127391157e+26))) {
		tmp = (t * sqrt(2.0)) / sqrt((4.0 * ((t * t) / x)) + (2.0 * ((t * t) + ((l / (cbrt(x) * cbrt(x))) * (l / cbrt(x))))));
	} else {
		tmp = (t * sqrt(2.0)) / ((t * sqrt(2.0)) + (((t / (x * x)) * ((2.0 / sqrt(2.0)) - (2.0 / (2.0 * sqrt(2.0))))) + (2.0 * (t / (sqrt(2.0) * x)))));
	}
	return tmp;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if t < -8.7759658810120904e129

    1. Initial program 56.2

      \[\]
    2. Taylor expanded around -inf 2.7

      \[\leadsto \]
    3. Simplified2.7

      \[\leadsto \]

    if -8.7759658810120904e129 < t < 3.42533297037213622e-276 or 1.95172909359687396e-167 < t < 2.24892081273911571e26

    1. Initial program 35.8

      \[\]
    2. Taylor expanded around inf 15.3

      \[\leadsto \]
    3. Simplified15.3

      \[\leadsto \]
    4. Using strategy rm
    5. Applied add-cube-cbrt15.3

      \[\leadsto \]
    6. Applied times-frac11.0

      \[\leadsto \]

    if 3.42533297037213622e-276 < t < 1.95172909359687396e-167 or 2.24892081273911571e26 < t

    1. Initial program 47.1

      \[\]
    2. Taylor expanded around inf 11.7

      \[\leadsto \]
    3. Simplified11.7

      \[\leadsto \]
  3. Recombined 3 regimes into one program.
  4. Final simplification9.7

    \[\leadsto \]

Reproduce

herbie shell --seed 2020338 
(FPCore (x l t)
  :name "Toniolo and Linder, Equation (7)"
  :precision binary64
  (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))