Average Error: 10.9 → 0.2
Time: 3.4s
Precision: binary64
\[x + \frac{y \cdot \left(z - t\right)}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{z - a} = -inf.0:\\ \;\;\;\;x + \frac{y}{z - a} \cdot \left(z - t\right)\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{z - a} \le 1.28025219849892211 \cdot 10^{265}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{z - a}
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{z - a} = -inf.0:\\
\;\;\;\;x + \frac{y}{z - a} \cdot \left(z - t\right)\\

\mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{z - a} \le 1.28025219849892211 \cdot 10^{265}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if ((((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a)))) <= -inf.0)) {
		VAR = ((double) (x + ((double) (((double) (y / ((double) (z - a)))) * ((double) (z - t))))));
	} else {
		double VAR_1;
		if ((((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a)))) <= 1.2802521984989221e+265)) {
			VAR_1 = ((double) (x + ((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a))))));
		} else {
			VAR_1 = ((double) (x + ((double) (y / ((double) (((double) (z - a)) / ((double) (z - 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.9
Target1.3
Herbie0.2
\[x + \frac{y}{\frac{z - a}{z - t}}\]

Derivation

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

    1. Initial program 64.0

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

      \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{z - t}}}\]
    4. Using strategy rm
    5. Applied associate-/r/0.1

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

    if -inf.0 < (/ (* y (- z t)) (- z a)) < 1.28025219849892211e265

    1. Initial program 0.2

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

    if 1.28025219849892211e265 < (/ (* y (- z t)) (- z a))

    1. Initial program 57.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{z - a} = -inf.0:\\ \;\;\;\;x + \frac{y}{z - a} \cdot \left(z - t\right)\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{z - a} \le 1.28025219849892211 \cdot 10^{265}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\ \end{array}\]

Reproduce

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

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

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