Average Error: 1.4 → 0.9
Time: 4.8s
Precision: binary64
\[x + y \cdot \frac{z - t}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;y \leq -3.273526225016458 \cdot 10^{-300}:\\ \;\;\;\;x + y \cdot \left(\left(z - t\right) \cdot \frac{1}{z - a}\right)\\ \mathbf{elif}\;y \leq 5.14749771507477 \cdot 10^{+22}:\\ \;\;\;\;x + \frac{1}{z - a} \cdot \left(y \cdot \left(z - t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{1}{\frac{z - a}{z - t}}\\ \end{array}\]
x + y \cdot \frac{z - t}{z - a}
\begin{array}{l}
\mathbf{if}\;y \leq -3.273526225016458 \cdot 10^{-300}:\\
\;\;\;\;x + y \cdot \left(\left(z - t\right) \cdot \frac{1}{z - a}\right)\\

\mathbf{elif}\;y \leq 5.14749771507477 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{1}{z - a} \cdot \left(y \cdot \left(z - t\right)\right)\\

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

\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
(FPCore (x y z t a)
 :precision binary64
 (if (<= y -3.273526225016458e-300)
   (+ x (* y (* (- z t) (/ 1.0 (- z a)))))
   (if (<= y 5.14749771507477e+22)
     (+ x (* (/ 1.0 (- z a)) (* y (- z t))))
     (+ x (* y (/ 1.0 (/ (- z a) (- z t))))))))
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 tmp;
	if ((y <= -3.273526225016458e-300)) {
		tmp = ((double) (x + ((double) (y * ((double) (((double) (z - t)) * (1.0 / ((double) (z - a)))))))));
	} else {
		double tmp_1;
		if ((y <= 5.14749771507477e+22)) {
			tmp_1 = ((double) (x + ((double) ((1.0 / ((double) (z - a))) * ((double) (y * ((double) (z - t))))))));
		} else {
			tmp_1 = ((double) (x + ((double) (y * (1.0 / (((double) (z - a)) / ((double) (z - t))))))));
		}
		tmp = tmp_1;
	}
	return tmp;
}

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

Derivation

  1. Split input into 3 regimes
  2. if y < -3.2735262250164581e-300

    1. Initial program Error: 1.5 bits

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

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

    if -3.2735262250164581e-300 < y < 5.14749771507476967e22

    1. Initial program Error: 2.0 bits

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

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

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

    if 5.14749771507476967e22 < y

    1. Initial program Error: 0.4 bits

      \[x + y \cdot \frac{z - t}{z - a}\]
    2. Using strategy rm
    3. Applied clear-numError: 0.4 bits

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.273526225016458 \cdot 10^{-300}:\\ \;\;\;\;x + y \cdot \left(\left(z - t\right) \cdot \frac{1}{z - a}\right)\\ \mathbf{elif}\;y \leq 5.14749771507477 \cdot 10^{+22}:\\ \;\;\;\;x + \frac{1}{z - a} \cdot \left(y \cdot \left(z - t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{1}{\frac{z - a}{z - t}}\\ \end{array}\]

Reproduce

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