Average Error: 11.2 → 1.2
Time: 7.6s
Precision: binary64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -3.0238400941313086 \cdot 10^{-142} \lor \neg \left(t \le 1.5459591352588837 \cdot 10^{-258}\right):\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{a - t} \cdot \left(z - t\right)\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;t \le -3.0238400941313086 \cdot 10^{-142} \lor \neg \left(t \le 1.5459591352588837 \cdot 10^{-258}\right):\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\

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

\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 <= -3.0238400941313086e-142) || !(t <= 1.5459591352588837e-258))) {
		VAR = ((double) (x + ((double) (y / ((double) (((double) (a - t)) / ((double) (z - t))))))));
	} else {
		VAR = ((double) (x + ((double) (((double) (y / ((double) (a - t)))) * ((double) (z - t))))));
	}
	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.2
Target1.2
Herbie1.2
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Split input into 2 regimes
  2. if t < -3.0238400941313086e-142 or 1.5459591352588837e-258 < t

    1. Initial program 12.6

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

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

    if -3.0238400941313086e-142 < t < 1.5459591352588837e-258

    1. Initial program 3.9

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -3.0238400941313086 \cdot 10^{-142} \lor \neg \left(t \le 1.5459591352588837 \cdot 10^{-258}\right):\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{a - t} \cdot \left(z - t\right)\\ \end{array}\]

Reproduce

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