Average Error: 16.3 → 8.4
Time: 20.5s
Precision: 64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -7.329630304780208437947829967576919046 \cdot 10^{-160}:\\ \;\;\;\;x + \left(y - \frac{y}{\frac{a}{z - t} - \frac{t}{\sqrt[3]{z - t}} \cdot \frac{\frac{1}{\sqrt[3]{z - t}}}{\sqrt[3]{z - t}}}\right)\\ \mathbf{elif}\;a \le 4.776220601035187966235421470923183704471 \cdot 10^{-100}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(y - \frac{z - t}{\frac{a - t}{y}}\right) + x\\ \end{array}\]
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
\mathbf{if}\;a \le -7.329630304780208437947829967576919046 \cdot 10^{-160}:\\
\;\;\;\;x + \left(y - \frac{y}{\frac{a}{z - t} - \frac{t}{\sqrt[3]{z - t}} \cdot \frac{\frac{1}{\sqrt[3]{z - t}}}{\sqrt[3]{z - t}}}\right)\\

\mathbf{elif}\;a \le 4.776220601035187966235421470923183704471 \cdot 10^{-100}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\

\mathbf{else}:\\
\;\;\;\;\left(y - \frac{z - t}{\frac{a - t}{y}}\right) + x\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r450159 = x;
        double r450160 = y;
        double r450161 = r450159 + r450160;
        double r450162 = z;
        double r450163 = t;
        double r450164 = r450162 - r450163;
        double r450165 = r450164 * r450160;
        double r450166 = a;
        double r450167 = r450166 - r450163;
        double r450168 = r450165 / r450167;
        double r450169 = r450161 - r450168;
        return r450169;
}

double f(double x, double y, double z, double t, double a) {
        double r450170 = a;
        double r450171 = -7.329630304780208e-160;
        bool r450172 = r450170 <= r450171;
        double r450173 = x;
        double r450174 = y;
        double r450175 = z;
        double r450176 = t;
        double r450177 = r450175 - r450176;
        double r450178 = r450170 / r450177;
        double r450179 = cbrt(r450177);
        double r450180 = r450176 / r450179;
        double r450181 = 1.0;
        double r450182 = r450181 / r450179;
        double r450183 = r450182 / r450179;
        double r450184 = r450180 * r450183;
        double r450185 = r450178 - r450184;
        double r450186 = r450174 / r450185;
        double r450187 = r450174 - r450186;
        double r450188 = r450173 + r450187;
        double r450189 = 4.776220601035188e-100;
        bool r450190 = r450170 <= r450189;
        double r450191 = r450174 * r450175;
        double r450192 = r450191 / r450176;
        double r450193 = r450173 + r450192;
        double r450194 = r450170 - r450176;
        double r450195 = r450194 / r450174;
        double r450196 = r450177 / r450195;
        double r450197 = r450174 - r450196;
        double r450198 = r450197 + r450173;
        double r450199 = r450190 ? r450193 : r450198;
        double r450200 = r450172 ? r450188 : r450199;
        return r450200;
}

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.4
Herbie8.4
\[\begin{array}{l} \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \lt -1.366497088939072697550672266103566343531 \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.475429344457723334351036314450840066235 \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 a < -7.329630304780208e-160

    1. Initial program 15.2

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Simplified15.2

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

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

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

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

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

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

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

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

    if -7.329630304780208e-160 < a < 4.776220601035188e-100

    1. Initial program 20.8

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Simplified20.8

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

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

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

    if 4.776220601035188e-100 < a

    1. Initial program 14.1

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Simplified14.1

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

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

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

      \[\leadsto x + \left(y - \frac{y}{\color{blue}{\frac{a}{z - t} - \frac{t}{z - t}}}\right)\]
    8. Using strategy rm
    9. Applied clear-num6.1

      \[\leadsto x + \left(y - \color{blue}{\frac{1}{\frac{\frac{a}{z - t} - \frac{t}{z - t}}{y}}}\right)\]
    10. Using strategy rm
    11. Applied *-un-lft-identity6.1

      \[\leadsto x + \left(y - \frac{1}{\frac{\frac{a}{z - t} - \frac{t}{z - t}}{\color{blue}{1 \cdot y}}}\right)\]
    12. Applied div-inv6.2

      \[\leadsto x + \left(y - \frac{1}{\frac{\frac{a}{z - t} - \color{blue}{t \cdot \frac{1}{z - t}}}{1 \cdot y}}\right)\]
    13. Applied div-inv6.2

      \[\leadsto x + \left(y - \frac{1}{\frac{\color{blue}{a \cdot \frac{1}{z - t}} - t \cdot \frac{1}{z - t}}{1 \cdot y}}\right)\]
    14. Applied distribute-rgt-out--6.2

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

      \[\leadsto x + \left(y - \frac{1}{\color{blue}{\frac{\frac{1}{z - t}}{1} \cdot \frac{a - t}{y}}}\right)\]
    16. Applied associate-/r*7.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -7.329630304780208437947829967576919046 \cdot 10^{-160}:\\ \;\;\;\;x + \left(y - \frac{y}{\frac{a}{z - t} - \frac{t}{\sqrt[3]{z - t}} \cdot \frac{\frac{1}{\sqrt[3]{z - t}}}{\sqrt[3]{z - t}}}\right)\\ \mathbf{elif}\;a \le 4.776220601035187966235421470923183704471 \cdot 10^{-100}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(y - \frac{z - t}{\frac{a - t}{y}}\right) + x\\ \end{array}\]

Reproduce

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