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

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

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

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

Derivation

  1. Split input into 2 regimes
  2. if t < 9.07721968675766e-106

    1. Initial program 1.1

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

    if 9.07721968675766e-106 < t

    1. Initial program 1.6

      \[x + y \cdot \frac{z - t}{z - a}\]
    2. Using strategy rm
    3. Applied clear-num1.6

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

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

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

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

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

Reproduce

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