Average Error: 16.3 → 8.0
Time: 18.4s
Precision: 64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -1.00134372473507665 \cdot 10^{-156} \lor \neg \left(a \le 2.65643182580772421 \cdot 10^{-175}\right):\\ \;\;\;\;x + \left(y - \left(z - t\right) \cdot \frac{y}{a - t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \end{array}\]
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
\mathbf{if}\;a \le -1.00134372473507665 \cdot 10^{-156} \lor \neg \left(a \le 2.65643182580772421 \cdot 10^{-175}\right):\\
\;\;\;\;x + \left(y - \left(z - t\right) \cdot \frac{y}{a - t}\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r480730 = x;
        double r480731 = y;
        double r480732 = r480730 + r480731;
        double r480733 = z;
        double r480734 = t;
        double r480735 = r480733 - r480734;
        double r480736 = r480735 * r480731;
        double r480737 = a;
        double r480738 = r480737 - r480734;
        double r480739 = r480736 / r480738;
        double r480740 = r480732 - r480739;
        return r480740;
}

double f(double x, double y, double z, double t, double a) {
        double r480741 = a;
        double r480742 = -1.0013437247350767e-156;
        bool r480743 = r480741 <= r480742;
        double r480744 = 2.656431825807724e-175;
        bool r480745 = r480741 <= r480744;
        double r480746 = !r480745;
        bool r480747 = r480743 || r480746;
        double r480748 = x;
        double r480749 = y;
        double r480750 = z;
        double r480751 = t;
        double r480752 = r480750 - r480751;
        double r480753 = r480741 - r480751;
        double r480754 = r480749 / r480753;
        double r480755 = r480752 * r480754;
        double r480756 = r480749 - r480755;
        double r480757 = r480748 + r480756;
        double r480758 = r480750 * r480749;
        double r480759 = r480758 / r480751;
        double r480760 = r480759 + r480748;
        double r480761 = r480747 ? r480757 : r480760;
        return r480761;
}

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
Herbie8.0
\[\begin{array}{l} \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \lt -1.3664970889390727 \cdot 10^{-7}:\\ \;\;\;\;\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} \lt 1.47542934445772333 \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.0013437247350767e-156 or 2.656431825807724e-175 < a

    1. Initial program 15.2

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

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

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

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

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

    if -1.0013437247350767e-156 < a < 2.656431825807724e-175

    1. Initial program 20.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -1.00134372473507665 \cdot 10^{-156} \lor \neg \left(a \le 2.65643182580772421 \cdot 10^{-175}\right):\\ \;\;\;\;x + \left(y - \left(z - t\right) \cdot \frac{y}{a - t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \end{array}\]

Reproduce

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

  :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))))