Average Error: 16.5 → 7.9
Time: 6.4s
Precision: 64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -1.2135765393209268 \cdot 10^{-175} \lor \neg \left(a \le 3.3317929205763182 \cdot 10^{-179}\right):\\ \;\;\;\;x + \left(y - \frac{z - t}{\frac{a - t}{y}}\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.2135765393209268 \cdot 10^{-175} \lor \neg \left(a \le 3.3317929205763182 \cdot 10^{-179}\right):\\
\;\;\;\;x + \left(y - \frac{z - t}{\frac{a - t}{y}}\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r636254 = x;
        double r636255 = y;
        double r636256 = r636254 + r636255;
        double r636257 = z;
        double r636258 = t;
        double r636259 = r636257 - r636258;
        double r636260 = r636259 * r636255;
        double r636261 = a;
        double r636262 = r636261 - r636258;
        double r636263 = r636260 / r636262;
        double r636264 = r636256 - r636263;
        return r636264;
}

double f(double x, double y, double z, double t, double a) {
        double r636265 = a;
        double r636266 = -1.2135765393209268e-175;
        bool r636267 = r636265 <= r636266;
        double r636268 = 3.331792920576318e-179;
        bool r636269 = r636265 <= r636268;
        double r636270 = !r636269;
        bool r636271 = r636267 || r636270;
        double r636272 = x;
        double r636273 = y;
        double r636274 = z;
        double r636275 = t;
        double r636276 = r636274 - r636275;
        double r636277 = r636265 - r636275;
        double r636278 = r636277 / r636273;
        double r636279 = r636276 / r636278;
        double r636280 = r636273 - r636279;
        double r636281 = r636272 + r636280;
        double r636282 = r636274 * r636273;
        double r636283 = r636282 / r636275;
        double r636284 = r636283 + r636272;
        double r636285 = r636271 ? r636281 : r636284;
        return r636285;
}

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.5
Target8.4
Herbie7.9
\[\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.2135765393209268e-175 or 3.331792920576318e-179 < 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 associate-/l*9.5

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

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

    if -1.2135765393209268e-175 < a < 3.331792920576318e-179

    1. Initial program 21.7

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

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

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

Reproduce

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