Average Error: 1.3 → 0.6
Time: 4.5s
Precision: binary64
\[x + y \cdot \frac{z - t}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;y \leq -6.977935169847292 \cdot 10^{-119} \lor \neg \left(y \leq 5.431832840092546 \cdot 10^{-53}\right):\\ \;\;\;\;x + y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{z - a}\\ \end{array}\]
x + y \cdot \frac{z - t}{z - a}
\begin{array}{l}
\mathbf{if}\;y \leq -6.977935169847292 \cdot 10^{-119} \lor \neg \left(y \leq 5.431832840092546 \cdot 10^{-53}\right):\\
\;\;\;\;x + y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)\\

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

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

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

Derivation

  1. Split input into 2 regimes
  2. if y < -6.9779351698472916e-119 or 5.43183284009254583e-53 < y

    1. Initial program Error: 0.7 bits

      \[x + y \cdot \frac{z - t}{z - a}\]
    2. Using strategy rm
    3. Applied div-subError: 0.7 bits

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

    if -6.9779351698472916e-119 < y < 5.43183284009254583e-53

    1. Initial program Error: 2.3 bits

      \[x + y \cdot \frac{z - t}{z - a}\]
    2. Using strategy rm
    3. Applied div-invError: 2.4 bits

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.977935169847292 \cdot 10^{-119} \lor \neg \left(y \leq 5.431832840092546 \cdot 10^{-53}\right):\\ \;\;\;\;x + y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{z - a}\\ \end{array}\]

Reproduce

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