Average Error: 1.5 → 0.9
Time: 5.5s
Precision: 64
\[x + y \cdot \frac{z - t}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \le -2.1155362594979767 \cdot 10^{165}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{z - a}\\ \end{array}\]
x + y \cdot \frac{z - t}{z - a}
\begin{array}{l}
\mathbf{if}\;\frac{z - t}{z - a} \le -2.1155362594979767 \cdot 10^{165}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{z - a}\\

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return (x + (y * ((z - t) / (z - a))));
}
double code(double x, double y, double z, double t, double a) {
	double temp;
	if ((((z - t) / (z - a)) <= -2.1155362594979767e+165)) {
		temp = (x + ((y * (z - t)) * (1.0 / (z - a))));
	} else {
		temp = (x + (y * ((z - t) / (z - a))));
	}
	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

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

Derivation

  1. Split input into 2 regimes
  2. if (/ (- z t) (- z a)) < -2.1155362594979767e+165

    1. Initial program 15.9

      \[x + y \cdot \frac{z - t}{z - a}\]
    2. Using strategy rm
    3. Applied div-inv15.9

      \[\leadsto x + y \cdot \color{blue}{\left(\left(z - t\right) \cdot \frac{1}{z - a}\right)}\]
    4. Applied associate-*r*1.5

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

    if -2.1155362594979767e+165 < (/ (- z t) (- z a))

    1. Initial program 0.8

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

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

Reproduce

herbie shell --seed 2020053 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
  :precision binary64

  :herbie-target
  (+ x (/ y (/ (- z a) (- z t))))

  (+ x (* y (/ (- z t) (- z a)))))