Average Error: 15.6 → 10.3
Time: 23.8s
Precision: 64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -4.772232824663429 \cdot 10^{-95}:\\ \;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\ \mathbf{elif}\;a \le 7.321420790149788 \cdot 10^{-153}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) - \frac{\left(z - t\right) \cdot \frac{y}{\sqrt[3]{a - t}}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}\\ \end{array}\]
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
\mathbf{if}\;a \le -4.772232824663429 \cdot 10^{-95}:\\
\;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\

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

\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{\left(z - t\right) \cdot \frac{y}{\sqrt[3]{a - t}}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r18542100 = x;
        double r18542101 = y;
        double r18542102 = r18542100 + r18542101;
        double r18542103 = z;
        double r18542104 = t;
        double r18542105 = r18542103 - r18542104;
        double r18542106 = r18542105 * r18542101;
        double r18542107 = a;
        double r18542108 = r18542107 - r18542104;
        double r18542109 = r18542106 / r18542108;
        double r18542110 = r18542102 - r18542109;
        return r18542110;
}

double f(double x, double y, double z, double t, double a) {
        double r18542111 = a;
        double r18542112 = -4.772232824663429e-95;
        bool r18542113 = r18542111 <= r18542112;
        double r18542114 = x;
        double r18542115 = y;
        double r18542116 = r18542114 + r18542115;
        double r18542117 = z;
        double r18542118 = t;
        double r18542119 = r18542117 - r18542118;
        double r18542120 = r18542111 - r18542118;
        double r18542121 = r18542120 / r18542115;
        double r18542122 = r18542119 / r18542121;
        double r18542123 = r18542116 - r18542122;
        double r18542124 = 7.321420790149788e-153;
        bool r18542125 = r18542111 <= r18542124;
        double r18542126 = r18542117 * r18542115;
        double r18542127 = r18542126 / r18542118;
        double r18542128 = r18542127 + r18542114;
        double r18542129 = cbrt(r18542120);
        double r18542130 = r18542115 / r18542129;
        double r18542131 = r18542119 * r18542130;
        double r18542132 = r18542129 * r18542129;
        double r18542133 = r18542131 / r18542132;
        double r18542134 = r18542116 - r18542133;
        double r18542135 = r18542125 ? r18542128 : r18542134;
        double r18542136 = r18542113 ? r18542123 : r18542135;
        return r18542136;
}

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

Original15.6
Target8.4
Herbie10.3
\[\begin{array}{l} \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \lt -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} \lt 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 a < -4.772232824663429e-95

    1. Initial program 14.4

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

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

    if -4.772232824663429e-95 < a < 7.321420790149788e-153

    1. Initial program 19.0

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

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

    if 7.321420790149788e-153 < a

    1. Initial program 14.3

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

      \[\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-frac9.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 associate-*l/11.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -4.772232824663429 \cdot 10^{-95}:\\ \;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\ \mathbf{elif}\;a \le 7.321420790149788 \cdot 10^{-153}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) - \frac{\left(z - t\right) \cdot \frac{y}{\sqrt[3]{a - t}}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}\\ \end{array}\]

Reproduce

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