Average Error: 10.7 → 0.3
Time: 4.9s
Precision: binary64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq -3.886810370241773 \cdot 10^{+306}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq 5.5747667159888895 \cdot 10^{+286}:\\ \;\;\;\;\frac{y \cdot \left(z - t\right)}{a - t} + x\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq -3.886810370241773 \cdot 10^{+306}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\

\mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq 5.5747667159888895 \cdot 10^{+286}:\\
\;\;\;\;\frac{y \cdot \left(z - t\right)}{a - t} + x\\

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

\end{array}
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 VAR;
	if (((((double) (y * ((double) (z - t)))) / ((double) (a - t))) <= -3.886810370241773e+306)) {
		VAR = ((double) (x + (y / (((double) (a - t)) / ((double) (z - t))))));
	} else {
		double VAR_1;
		if (((((double) (y * ((double) (z - t)))) / ((double) (a - t))) <= 5.5747667159888895e+286)) {
			VAR_1 = ((double) ((((double) (y * ((double) (z - t)))) / ((double) (a - t))) + x));
		} else {
			VAR_1 = ((double) (x + ((double) (y * (((double) (z - t)) / ((double) (a - t)))))));
		}
		VAR = VAR_1;
	}
	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

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

Derivation

  1. Split input into 3 regimes
  2. if (/ (* y (- z t)) (- a t)) < -3.886810370241773e306

    1. Initial program 63.7

      \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
    2. Using strategy rm
    3. Applied associate-/l*0.1

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

    if -3.886810370241773e306 < (/ (* y (- z t)) (- a t)) < 5.57476671598888951e286

    1. Initial program 0.2

      \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]

    if 5.57476671598888951e286 < (/ (* y (- z t)) (- a t))

    1. Initial program 60.2

      \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
    2. Simplified0.8

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq -3.886810370241773 \cdot 10^{+306}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq 5.5747667159888895 \cdot 10^{+286}:\\ \;\;\;\;\frac{y \cdot \left(z - t\right)}{a - t} + x\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array}\]

Reproduce

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