Average Error: 11.5 → 1.4
Time: 5.8s
Precision: binary64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -2.5240492959418074 \cdot 10^{-160}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;t \le 2.26106697662143853 \cdot 10^{-189}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;t \le -2.5240492959418074 \cdot 10^{-160}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a - t}\\

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

\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{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) (a - t))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if ((t <= -2.5240492959418074e-160)) {
		VAR = ((double) (x + ((double) (y * ((double) (((double) (z - t)) / ((double) (a - t))))))));
	} else {
		double VAR_1;
		if ((t <= 2.2610669766214385e-189)) {
			VAR_1 = ((double) (x + ((double) (((double) (y * ((double) (z - t)))) / ((double) (a - t))))));
		} else {
			VAR_1 = ((double) (x + ((double) (y / ((double) (((double) (a - t)) / ((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

Original11.5
Target1.4
Herbie1.4
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Split input into 3 regimes
  2. if t < -2.5240492959418074e-160

    1. Initial program 13.5

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

      \[\leadsto x + \frac{y \cdot \left(z - t\right)}{\color{blue}{1 \cdot \left(a - t\right)}}\]
    4. Applied times-frac0.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.5240492959418074e-160 < t < 2.26106697662143853e-189

    1. Initial program 4.1

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

    if 2.26106697662143853e-189 < t

    1. Initial program 13.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.5240492959418074 \cdot 10^{-160}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;t \le 2.26106697662143853 \cdot 10^{-189}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \end{array}\]

Reproduce

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