Average Error: 10.5 → 0.5
Time: 4.0s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -8.06295942082695449 \cdot 10^{-47} \lor \neg \left(y \le 2.9727451954759292 \cdot 10^{-48}\right):\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;y \le -8.06295942082695449 \cdot 10^{-47} \lor \neg \left(y \le 2.9727451954759292 \cdot 10^{-48}\right):\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\

\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - 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 (((y <= -8.0629594208269545e-47) || !(y <= 2.972745195475929e-48))) {
		VAR = ((double) (x + ((double) (y / ((double) (((double) (a - t)) / ((double) (z - t))))))));
	} else {
		VAR = ((double) (x + ((double) (((double) (y * ((double) (z - t)))) * ((double) (1.0 / ((double) (a - 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

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

Derivation

  1. Split input into 2 regimes
  2. if y < -8.0629594208269545e-47 or 2.972745195475929e-48 < y

    1. Initial program 19.1

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

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

    if -8.0629594208269545e-47 < y < 2.972745195475929e-48

    1. Initial program 0.4

      \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
    2. Using strategy rm
    3. Applied div-inv0.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -8.06295942082695449 \cdot 10^{-47} \lor \neg \left(y \le 2.9727451954759292 \cdot 10^{-48}\right):\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\ \end{array}\]

Reproduce

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