Average Error: 1.3 → 0.6
Time: 4.4s
Precision: binary64
\[x + y \cdot \frac{z - t}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;y \leq -745928871119.6415 \lor \neg \left(y \leq 9.244173049080096 \cdot 10^{-179}\right):\\ \;\;\;\;x + y \cdot \frac{z - t}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\ \end{array}\]
x + y \cdot \frac{z - t}{z - a}
\begin{array}{l}
\mathbf{if}\;y \leq -745928871119.6415 \lor \neg \left(y \leq 9.244173049080096 \cdot 10^{-179}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z - a}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\

\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= y -745928871119.6415) (not (<= y 9.244173049080096e-179)))
   (+ x (* y (/ (- z t) (- z a))))
   (+ x (/ (* y (- z t)) (- z a)))))
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (y * (((double) (z - t)) / ((double) (z - a)))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if (((y <= -745928871119.6415) || !(y <= 9.244173049080096e-179))) {
		VAR = ((double) (x + ((double) (y * (((double) (z - t)) / ((double) (z - a)))))));
	} else {
		VAR = ((double) (x + (((double) (y * ((double) (z - t)))) / ((double) (z - a)))));
	}
	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.3
Target1.2
Herbie0.6
\[x + \frac{y}{\frac{z - a}{z - t}}\]

Derivation

  1. Split input into 2 regimes
  2. if y < -745928871119.641479 or 9.24417304908009578e-179 < y

    1. Initial program 0.7

      \[x + y \cdot \frac{z - t}{z - a}\]

    if -745928871119.641479 < y < 9.24417304908009578e-179

    1. Initial program 2.1

      \[x + y \cdot \frac{z - t}{z - a}\]
    2. Using strategy rm
    3. Applied associate-*r/0.4

      \[\leadsto x + \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -745928871119.6415 \lor \neg \left(y \leq 9.244173049080096 \cdot 10^{-179}\right):\\ \;\;\;\;x + y \cdot \frac{z - t}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\ \end{array}\]

Reproduce

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

  :herbie-target
  (+ x (/ y (/ (- z a) (- z t))))

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