Average Error: 10.3 → 0.4
Time: 4.3s
Precision: binary64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \leq -3.712470684381313 \cdot 10^{-56} \lor \neg \left(y \leq 6.017694748396223 \cdot 10^{-52}\right):\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;y \leq -3.712470684381313 \cdot 10^{-56} \lor \neg \left(y \leq 6.017694748396223 \cdot 10^{-52}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{a - t}\\

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

\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= y -3.712470684381313e-56) (not (<= y 6.017694748396223e-52)))
   (+ x (* y (/ (- z t) (- a t))))
   (+ x (/ (* y (- z t)) (- a t)))))
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + (((double) (y * ((double) (z - t)))) / ((double) (a - t)))));
}
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (((y <= -3.712470684381313e-56) || !(y <= 6.017694748396223e-52))) {
		tmp = ((double) (x + ((double) (y * (((double) (z - t)) / ((double) (a - t)))))));
	} else {
		tmp = ((double) (x + (((double) (y * ((double) (z - t)))) / ((double) (a - t)))));
	}
	return tmp;
}

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

Original10.3
Target1.3
Herbie0.4
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Split input into 2 regimes
  2. if y < -3.71247068438131292e-56 or 6.01769474839622299e-52 < y

    1. Initial program Error: 18.4 bits

      \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
    2. SimplifiedError: 0.4 bits

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

    if -3.71247068438131292e-56 < y < 6.01769474839622299e-52

    1. Initial program Error: 0.4 bits

      \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
  3. Recombined 2 regimes into one program.
  4. Final simplificationError: 0.4 bits

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

Reproduce

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

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

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