Average Error: 16.8 → 11.0
Time: 15.8s
Precision: 64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -6.6057660298985682 \cdot 10^{137}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{elif}\;t \le 4.2840164135106727 \cdot 10^{-5}:\\ \;\;\;\;x + \left(y - \frac{\left(z - t\right) \cdot y}{a - t}\right)\\ \mathbf{elif}\;t \le 2.1017965543309036 \cdot 10^{103}:\\ \;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\ \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}\;t \le -6.6057660298985682 \cdot 10^{137}:\\
\;\;\;\;\frac{z \cdot y}{t} + x\\

\mathbf{elif}\;t \le 4.2840164135106727 \cdot 10^{-5}:\\
\;\;\;\;x + \left(y - \frac{\left(z - t\right) \cdot y}{a - t}\right)\\

\mathbf{elif}\;t \le 2.1017965543309036 \cdot 10^{103}:\\
\;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r715312 = x;
        double r715313 = y;
        double r715314 = r715312 + r715313;
        double r715315 = z;
        double r715316 = t;
        double r715317 = r715315 - r715316;
        double r715318 = r715317 * r715313;
        double r715319 = a;
        double r715320 = r715319 - r715316;
        double r715321 = r715318 / r715320;
        double r715322 = r715314 - r715321;
        return r715322;
}

double f(double x, double y, double z, double t, double a) {
        double r715323 = t;
        double r715324 = -6.605766029898568e+137;
        bool r715325 = r715323 <= r715324;
        double r715326 = z;
        double r715327 = y;
        double r715328 = r715326 * r715327;
        double r715329 = r715328 / r715323;
        double r715330 = x;
        double r715331 = r715329 + r715330;
        double r715332 = 4.284016413510673e-05;
        bool r715333 = r715323 <= r715332;
        double r715334 = r715326 - r715323;
        double r715335 = r715334 * r715327;
        double r715336 = a;
        double r715337 = r715336 - r715323;
        double r715338 = r715335 / r715337;
        double r715339 = r715327 - r715338;
        double r715340 = r715330 + r715339;
        double r715341 = 2.1017965543309036e+103;
        bool r715342 = r715323 <= r715341;
        double r715343 = r715330 + r715327;
        double r715344 = r715337 / r715327;
        double r715345 = r715334 / r715344;
        double r715346 = r715343 - r715345;
        double r715347 = r715342 ? r715346 : r715331;
        double r715348 = r715333 ? r715340 : r715347;
        double r715349 = r715325 ? r715331 : r715348;
        return r715349;
}

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.8
Target8.6
Herbie11.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 3 regimes
  2. if t < -6.605766029898568e+137 or 2.1017965543309036e+103 < t

    1. Initial program 32.3

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

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

    if -6.605766029898568e+137 < t < 4.284016413510673e-05

    1. Initial program 8.5

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

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

    if 4.284016413510673e-05 < t < 2.1017965543309036e+103

    1. Initial program 14.9

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

      \[\leadsto \left(x + y\right) - \color{blue}{\frac{z - t}{\frac{a - t}{y}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification11.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -6.6057660298985682 \cdot 10^{137}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{elif}\;t \le 4.2840164135106727 \cdot 10^{-5}:\\ \;\;\;\;x + \left(y - \frac{\left(z - t\right) \cdot y}{a - t}\right)\\ \mathbf{elif}\;t \le 2.1017965543309036 \cdot 10^{103}:\\ \;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \end{array}\]

Reproduce

herbie shell --seed 2020045 
(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 (- 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 (- a t))) y))))

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