Average Error: 15.7 → 9.2
Time: 13.3s
Precision: 64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -3.5542536611877635 \cdot 10^{-199}:\\ \;\;\;\;x + \left(y - \left(\sqrt[3]{\frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}} \cdot \sqrt[3]{\frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}}\right) \cdot \left(\sqrt[3]{\frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}} \cdot \frac{y}{\sqrt[3]{a - t}}\right)\right)\\ \mathbf{elif}\;a \le 4.417797676349528 \cdot 10^{-36}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) - \frac{y}{a - t} \cdot \left(z - t\right)\\ \end{array}\]
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
\mathbf{if}\;a \le -3.5542536611877635 \cdot 10^{-199}:\\
\;\;\;\;x + \left(y - \left(\sqrt[3]{\frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}} \cdot \sqrt[3]{\frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}}\right) \cdot \left(\sqrt[3]{\frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}} \cdot \frac{y}{\sqrt[3]{a - t}}\right)\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r10196777 = x;
        double r10196778 = y;
        double r10196779 = r10196777 + r10196778;
        double r10196780 = z;
        double r10196781 = t;
        double r10196782 = r10196780 - r10196781;
        double r10196783 = r10196782 * r10196778;
        double r10196784 = a;
        double r10196785 = r10196784 - r10196781;
        double r10196786 = r10196783 / r10196785;
        double r10196787 = r10196779 - r10196786;
        return r10196787;
}

double f(double x, double y, double z, double t, double a) {
        double r10196788 = a;
        double r10196789 = -3.5542536611877635e-199;
        bool r10196790 = r10196788 <= r10196789;
        double r10196791 = x;
        double r10196792 = y;
        double r10196793 = z;
        double r10196794 = t;
        double r10196795 = r10196793 - r10196794;
        double r10196796 = r10196788 - r10196794;
        double r10196797 = cbrt(r10196796);
        double r10196798 = r10196797 * r10196797;
        double r10196799 = r10196795 / r10196798;
        double r10196800 = cbrt(r10196799);
        double r10196801 = r10196800 * r10196800;
        double r10196802 = r10196792 / r10196797;
        double r10196803 = r10196800 * r10196802;
        double r10196804 = r10196801 * r10196803;
        double r10196805 = r10196792 - r10196804;
        double r10196806 = r10196791 + r10196805;
        double r10196807 = 4.417797676349528e-36;
        bool r10196808 = r10196788 <= r10196807;
        double r10196809 = r10196792 * r10196793;
        double r10196810 = r10196809 / r10196794;
        double r10196811 = r10196791 + r10196810;
        double r10196812 = r10196791 + r10196792;
        double r10196813 = r10196792 / r10196796;
        double r10196814 = r10196813 * r10196795;
        double r10196815 = r10196812 - r10196814;
        double r10196816 = r10196808 ? r10196811 : r10196815;
        double r10196817 = r10196790 ? r10196806 : r10196816;
        return r10196817;
}

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.7
Target7.9
Herbie9.2
\[\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 < -3.5542536611877635e-199

    1. Initial program 15.2

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt15.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.6

      \[\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+9.0

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

      \[\leadsto x + \left(y - \color{blue}{\left(\left(\sqrt[3]{\frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}} \cdot \sqrt[3]{\frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}}\right) \cdot \sqrt[3]{\frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}}\right)} \cdot \frac{y}{\sqrt[3]{a - t}}\right)\]
    9. Applied associate-*l*9.2

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

    if -3.5542536611877635e-199 < a < 4.417797676349528e-36

    1. Initial program 19.6

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

      \[\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-frac18.1

      \[\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+16.7

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

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

    if 4.417797676349528e-36 < a

    1. Initial program 12.8

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

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

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

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

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

Reproduce

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