Average Error: 11.0 → 0.7
Time: 3.5s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{z - a} \le -5.0244504192606074 \cdot 10^{-89} \lor \neg \left(\frac{y \cdot \left(z - t\right)}{z - a} \le 9.3364688868456538 \cdot 10^{297}\right):\\ \;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\ \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} \le -5.0244504192606074 \cdot 10^{-89} \lor \neg \left(\frac{y \cdot \left(z - t\right)}{z - a} \le 9.3364688868456538 \cdot 10^{297}\right):\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\

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

\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)))) <= -5.0244504192606074e-89) || !(((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a)))) <= 9.336468886845654e+297))) {
		VAR = ((double) (x + ((double) (y / ((double) (((double) (z - a)) / ((double) (z - t))))))));
	} else {
		VAR = ((double) (x + ((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a))))));
	}
	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.0
Target1.3
Herbie0.7
\[x + \frac{y}{\frac{z - a}{z - t}}\]

Derivation

  1. Split input into 2 regimes
  2. if (/ (* y (- z t)) (- z a)) < -5.0244504192606074e-89 or 9.336468886845654e+297 < (/ (* y (- z t)) (- z a))

    1. Initial program 27.4

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

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

    if -5.0244504192606074e-89 < (/ (* y (- z t)) (- z a)) < 9.336468886845654e+297

    1. Initial program 0.2

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

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

Reproduce

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