Average Error: 10.5 → 0.7
Time: 3.8s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} = -\infty \lor \neg \left(\frac{y \cdot \left(z - t\right)}{a - t} \le 5.30694639996039108 \cdot 10^{80}\right):\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} = -\infty \lor \neg \left(\frac{y \cdot \left(z - t\right)}{a - t} \le 5.30694639996039108 \cdot 10^{80}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{a - t}\\

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return (x + ((y * (z - t)) / (a - t)));
}
double code(double x, double y, double z, double t, double a) {
	double temp;
	if (((((y * (z - t)) / (a - t)) <= -inf.0) || !(((y * (z - t)) / (a - t)) <= 5.306946399960391e+80))) {
		temp = (x + (y * ((z - t) / (a - t))));
	} else {
		temp = (x + ((y * (z - t)) / (a - t)));
	}
	return temp;
}

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.2
Herbie0.7
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Split input into 2 regimes
  2. if (/ (* y (- z t)) (- a t)) < -inf.0 or 5.306946399960391e+80 < (/ (* y (- z t)) (- a t))

    1. Initial program 41.6

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

      \[\leadsto x + \frac{y \cdot \left(z - t\right)}{\color{blue}{1 \cdot \left(a - t\right)}}\]
    4. Applied times-frac2.2

      \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{z - t}{a - t}}\]
    5. Simplified2.2

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

    if -inf.0 < (/ (* y (- z t)) (- a t)) < 5.306946399960391e+80

    1. Initial program 0.2

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

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

Reproduce

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