Average Error: 16.5 → 8.5
Time: 7.4s
Precision: binary64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;t \leq -1.2036233452053093 \cdot 10^{+133}:\\ \;\;\;\;x + \frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq 3.799812770073835 \cdot 10^{+194}:\\ \;\;\;\;\left(x + y\right) - \left(\left(z - t\right) \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{a - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z \cdot y}{t}\\ \end{array}\]
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
\mathbf{if}\;t \leq -1.2036233452053093 \cdot 10^{+133}:\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\

\mathbf{elif}\;t \leq 3.799812770073835 \cdot 10^{+194}:\\
\;\;\;\;\left(x + y\right) - \left(\left(z - t\right) \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{a - t}}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{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 (<= t -1.2036233452053093e+133)
   (+ x (/ z (/ t y)))
   (if (<= t 3.799812770073835e+194)
     (-
      (+ x y)
      (*
       (* (- z t) (/ (* (cbrt y) (cbrt y)) (* (cbrt (- a t)) (cbrt (- a t)))))
       (/ (cbrt y) (cbrt (- a t)))))
     (+ x (/ (* z y) 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 (t <= -1.2036233452053093e+133) {
		tmp = x + (z / (t / y));
	} else if (t <= 3.799812770073835e+194) {
		tmp = (x + y) - (((z - t) * ((cbrt(y) * cbrt(y)) / (cbrt(a - t) * cbrt(a - t)))) * (cbrt(y) / cbrt(a - t)));
	} else {
		tmp = x + ((z * y) / 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.5
Target8.5
Herbie8.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 3 regimes
  2. if t < -1.2036233452053093e133

    1. Initial program 33.2

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

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

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

      \[\leadsto \left(x + y\right) - \color{blue}{\left(z - t\right)} \cdot \frac{y}{a - t}\]
    6. Using strategy rm
    7. Applied clear-num_binary6424.0

      \[\leadsto \left(x + y\right) - \left(z - t\right) \cdot \color{blue}{\frac{1}{\frac{a - t}{y}}}\]
    8. Taylor expanded around inf 18.2

      \[\leadsto \color{blue}{\frac{z \cdot y}{t} + x}\]
    9. Simplified12.6

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

    if -1.2036233452053093e133 < t < 3.7998127700738351e194

    1. Initial program 11.0

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

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

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

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

      \[\leadsto \left(x + y\right) - \left(z - t\right) \cdot \frac{y}{\color{blue}{\left(\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}\right) \cdot \sqrt[3]{a - t}}}\]
    8. Applied add-cube-cbrt_binary648.1

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

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

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

    if 3.7998127700738351e194 < t

    1. Initial program 34.2

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.2036233452053093 \cdot 10^{+133}:\\ \;\;\;\;x + \frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq 3.799812770073835 \cdot 10^{+194}:\\ \;\;\;\;\left(x + y\right) - \left(\left(z - t\right) \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{a - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z \cdot y}{t}\\ \end{array}\]

Reproduce

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