Average Error: 10.9 → 0.8
Time: 12.8s
Precision: binary64
\[x + \frac{y \cdot \left(z - t\right)}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;y \leq -1.0867585865650249 \cdot 10^{+71}:\\ \;\;\;\;x + y \cdot \frac{z - t}{z - a}\\ \mathbf{elif}\;y \leq 1.5516949149729753 \cdot 10^{-09}:\\ \;\;\;\;\left(x + \frac{y \cdot z}{z - a}\right) - \frac{y \cdot t}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{1}{\frac{z - t}{z - a}}}\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{z - a}
\begin{array}{l}
\mathbf{if}\;y \leq -1.0867585865650249 \cdot 10^{+71}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z - a}\\

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

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

\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 -1.0867585865650249e+71)
   (+ x (* y (/ (- z t) (- z a))))
   (if (<= y 1.5516949149729753e-09)
     (- (+ x (/ (* y z) (- z a))) (/ (* y t) (- z a)))
     (+ x (/ y (/ 1.0 (/ (- z t) (- z a))))))))
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 tmp;
	if (y <= -1.0867585865650249e+71) {
		tmp = x + (y * ((z - t) / (z - a)));
	} else if (y <= 1.5516949149729753e-09) {
		tmp = (x + ((y * z) / (z - a))) - ((y * t) / (z - a));
	} else {
		tmp = x + (y / (1.0 / ((z - t) / (z - a))));
	}
	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

Original10.9
Target1.1
Herbie0.8
\[x + \frac{y}{\frac{z - a}{z - t}}\]

Derivation

  1. Split input into 3 regimes
  2. if y < -1.0867585865650249e71

    1. Initial program 29.4

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

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

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

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

    if -1.0867585865650249e71 < y < 1.5516949149729753e-9

    1. Initial program 1.1

      \[x + \frac{y \cdot \left(z - t\right)}{z - a}\]
    2. Taylor expanded around 0 1.1

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

    if 1.5516949149729753e-9 < y

    1. Initial program 21.7

      \[x + \frac{y \cdot \left(z - t\right)}{z - a}\]
    2. Using strategy rm
    3. Applied associate-/l*_binary64_136630.3

      \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{z - t}}}\]
    4. Using strategy rm
    5. Applied clear-num_binary64_137170.4

      \[\leadsto x + \frac{y}{\color{blue}{\frac{1}{\frac{z - t}{z - a}}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.8

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

Reproduce

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

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

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