Average Error: 1.4 → 0.8
Time: 4.5s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (y * ((double) (((double) (z - t)) / ((double) (a - t))))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if ((((double) (((double) (z - t)) / ((double) (a - t)))) <= -inf.0)) {
		VAR = ((double) (x + ((double) (((double) (((double) (z * y)) - ((double) (t * y)))) / ((double) (a - t))))));
	} else {
		VAR = ((double) (x + ((double) (y / ((double) (((double) (a - t)) / ((double) (z - t))))))));
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original1.4
Target0.4
Herbie0.8
\[\]

Derivation

  1. Split input into 2 regimes
  2. if (/ (- z t) (- a t)) < -inf.0

    1. Initial program 64.0

      \[\]
    2. Using strategy rm
    3. Applied associate-*r/0.2

      \[\leadsto \]
    4. Using strategy rm
    5. Applied sub-neg0.2

      \[\leadsto \]
    6. Applied distribute-lft-in0.2

      \[\leadsto \]

    if -inf.0 < (/ (- z t) (- a t))

    1. Initial program 0.8

      \[\]
    2. Using strategy rm
    3. Applied associate-*r/10.7

      \[\leadsto \]
    4. Using strategy rm
    5. Applied associate-/l*0.8

      \[\leadsto \]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.8

    \[\leadsto \]

Reproduce

herbie shell --seed 2020192 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
  :precision binary64

  :herbie-target
  (if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

  (+ x (* y (/ (- z t) (- a t)))))