Average Error: 10.9 → 0.6
Time: 4.6s
Precision: binary64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \leq -2.4894281283083287 \cdot 10^{-39} \lor \neg \left(y \leq 1.0004809981351819 \cdot 10^{-91}\right):\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot z - y \cdot t}{a - t}\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;y \leq -2.4894281283083287 \cdot 10^{-39} \lor \neg \left(y \leq 1.0004809981351819 \cdot 10^{-91}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{a - t}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z - y \cdot t}{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 -2.4894281283083287e-39) (not (<= y 1.0004809981351819e-91)))
   (+ x (* y (/ (- z t) (- a t))))
   (+ x (/ (- (* y z) (* y 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 <= -2.4894281283083287e-39) || !(y <= 1.0004809981351819e-91))) {
		tmp = ((double) (x + ((double) (y * (((double) (z - t)) / ((double) (a - t)))))));
	} else {
		tmp = ((double) (x + (((double) (((double) (y * z)) - ((double) (y * 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.9
Target1.3
Herbie0.6
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Split input into 2 regimes
  2. if y < -2.48942812830832866e-39 or 1.0004809981351819e-91 < y

    1. Initial program 18.7

      \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity_binary6418.7

      \[\leadsto x + \frac{y \cdot \left(z - t\right)}{\color{blue}{1 \cdot \left(a - t\right)}}\]
    4. Applied times-frac_binary640.7

      \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{z - t}{a - t}}\]
    5. Simplified0.7

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

    if -2.48942812830832866e-39 < y < 1.0004809981351819e-91

    1. Initial program 0.5

      \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
    2. Using strategy rm
    3. Applied sub-neg_binary640.5

      \[\leadsto x + \frac{y \cdot \color{blue}{\left(z + \left(-t\right)\right)}}{a - t}\]
    4. Applied distribute-lft-in_binary640.5

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

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

Reproduce

herbie shell --seed 2020210 
(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))))