Average Error: 16.3 → 9.5
Time: 8.3s
Precision: binary64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \leq -1.9550660631378832 \cdot 10^{-23} \lor \neg \left(a \leq 4.600289979140278 \cdot 10^{-113}\right):\\ \;\;\;\;\left(x + y\right) - \frac{\frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}}{\sqrt[3]{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}} \cdot \frac{y}{\sqrt[3]{\sqrt[3]{a - t}}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \end{array}\]
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
\mathbf{if}\;a \leq -1.9550660631378832 \cdot 10^{-23} \lor \neg \left(a \leq 4.600289979140278 \cdot 10^{-113}\right):\\
\;\;\;\;\left(x + y\right) - \frac{\frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}}{\sqrt[3]{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}} \cdot \frac{y}{\sqrt[3]{\sqrt[3]{a - t}}}\\

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

\end{array}
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= a -1.9550660631378832e-23) (not (<= a 4.600289979140278e-113)))
   (-
    (+ x y)
    (*
     (/
      (/ (- z t) (* (cbrt (- a t)) (cbrt (- a t))))
      (cbrt (* (cbrt (- a t)) (cbrt (- a t)))))
     (/ y (cbrt (cbrt (- a t))))))
   (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t, double a) {
	return (x + y) - (((z - t) * y) / (a - t));
}
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -1.9550660631378832e-23) || !(a <= 4.600289979140278e-113)) {
		tmp = (x + y) - ((((z - t) / (cbrt(a - t) * cbrt(a - t))) / cbrt(cbrt(a - t) * cbrt(a - t))) * (y / cbrt(cbrt(a - t))));
	} else {
		tmp = x + ((y * z) / t);
	}
	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

Original16.3
Target8.1
Herbie9.5
\[\begin{array}{l} \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} < -1.3664970889390727 \cdot 10^{-07}:\\ \;\;\;\;\left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\ \mathbf{elif}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} < 1.4754293444577233 \cdot 10^{-239}:\\ \;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if a < -1.9550660631378832e-23 or 4.60028997914027815e-113 < a

    1. Initial program 14.5

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt_binary6414.6

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

      \[\leadsto \left(x + y\right) - \color{blue}{\frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{y}{\sqrt[3]{a - t}}}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt_binary647.3

      \[\leadsto \left(x + y\right) - \frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{y}{\sqrt[3]{\color{blue}{\left(\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}\right) \cdot \sqrt[3]{a - t}}}}\]
    7. Applied cbrt-prod_binary647.3

      \[\leadsto \left(x + y\right) - \frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{y}{\color{blue}{\sqrt[3]{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \sqrt[3]{\sqrt[3]{a - t}}}}\]
    8. Applied *-un-lft-identity_binary647.3

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

      \[\leadsto \left(x + y\right) - \frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}} \cdot \frac{y}{\sqrt[3]{\sqrt[3]{a - t}}}\right)}\]
    10. Applied associate-*r*_binary647.2

      \[\leadsto \left(x + y\right) - \color{blue}{\left(\frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{1}{\sqrt[3]{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}}\right) \cdot \frac{y}{\sqrt[3]{\sqrt[3]{a - t}}}}\]
    11. Simplified7.2

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

    if -1.9550660631378832e-23 < a < 4.60028997914027815e-113

    1. Initial program 19.7

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

      \[\leadsto \color{blue}{\frac{z \cdot y}{t} + x}\]
    3. Simplified13.5

      \[\leadsto \color{blue}{x + \frac{z \cdot y}{t}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification9.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.9550660631378832 \cdot 10^{-23} \lor \neg \left(a \leq 4.600289979140278 \cdot 10^{-113}\right):\\ \;\;\;\;\left(x + y\right) - \frac{\frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}}{\sqrt[3]{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}} \cdot \frac{y}{\sqrt[3]{\sqrt[3]{a - t}}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-07) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))

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