Average Error: 16.4 → 7.6
Time: 6.0s
Precision: binary64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \leq -1.438849187731562 \cdot 10^{-163} \lor \neg \left(a \leq 6.542204967337177 \cdot 10^{-115}\right):\\ \;\;\;\;x + \left(y - \frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{\sqrt[3]{a - t}} \cdot \left(\frac{y}{\sqrt[3]{a - t}} \cdot \frac{\sqrt[3]{z - t}}{\sqrt[3]{a - t}}\right)\right)\\ \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.438849187731562 \cdot 10^{-163} \lor \neg \left(a \leq 6.542204967337177 \cdot 10^{-115}\right):\\
\;\;\;\;x + \left(y - \frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{\sqrt[3]{a - t}} \cdot \left(\frac{y}{\sqrt[3]{a - t}} \cdot \frac{\sqrt[3]{z - t}}{\sqrt[3]{a - t}}\right)\right)\\

\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.438849187731562e-163) (not (<= a 6.542204967337177e-115)))
   (+
    x
    (-
     y
     (*
      (/ (* (cbrt (- z t)) (cbrt (- z t))) (cbrt (- a t)))
      (* (/ y (cbrt (- a t))) (/ (cbrt (- z t)) (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.438849187731562e-163) || !(a <= 6.542204967337177e-115)) {
		tmp = x + (y - (((cbrt(z - t) * cbrt(z - t)) / cbrt(a - t)) * ((y / cbrt(a - t)) * (cbrt(z - t) / 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.4
Target8.5
Herbie7.6
\[\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.43884918773156206e-163 or 6.5422049673371766e-115 < a

    1. Initial program 15.0

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

      \[\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_binary649.0

      \[\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_binary649.0

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

      \[\leadsto \left(x + y\right) - \color{blue}{\left(\frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \left(\sqrt[3]{\frac{y}{\sqrt[3]{a - t}}} \cdot \sqrt[3]{\frac{y}{\sqrt[3]{a - t}}}\right)\right) \cdot \sqrt[3]{\frac{y}{\sqrt[3]{a - t}}}}\]
    8. Using strategy rm
    9. Applied associate--l+_binary648.7

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

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

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

      \[\leadsto x + \left(y - \color{blue}{\left(\frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{\sqrt[3]{a - t}} \cdot \frac{\sqrt[3]{z - t}}{\sqrt[3]{a - t}}\right)} \cdot \frac{y}{\sqrt[3]{a - t}}\right)\]
    14. Applied associate-*l*_binary646.5

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

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

    if -1.43884918773156206e-163 < a < 6.5422049673371766e-115

    1. Initial program 20.6

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

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

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

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

Reproduce

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