Average Error: 25.0 → 9.2
Time: 7.6s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \le -2.18267612385008751 \cdot 10^{-243}:\\ \;\;\;\;x + \frac{1}{\frac{\frac{a - t}{z - t}}{y - x}}\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \le 0.0:\\ \;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\sqrt[3]{y - x}}{\frac{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}{\sqrt[3]{y - x}}} \cdot \frac{\sqrt[3]{y - x}}{\frac{\sqrt[3]{a - t}}{z - t}}\\ \end{array}\]
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \le -2.18267612385008751 \cdot 10^{-243}:\\
\;\;\;\;x + \frac{1}{\frac{\frac{a - t}{z - t}}{y - x}}\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r619009 = x;
        double r619010 = y;
        double r619011 = r619010 - r619009;
        double r619012 = z;
        double r619013 = t;
        double r619014 = r619012 - r619013;
        double r619015 = r619011 * r619014;
        double r619016 = a;
        double r619017 = r619016 - r619013;
        double r619018 = r619015 / r619017;
        double r619019 = r619009 + r619018;
        return r619019;
}

double f(double x, double y, double z, double t, double a) {
        double r619020 = x;
        double r619021 = y;
        double r619022 = r619021 - r619020;
        double r619023 = z;
        double r619024 = t;
        double r619025 = r619023 - r619024;
        double r619026 = r619022 * r619025;
        double r619027 = a;
        double r619028 = r619027 - r619024;
        double r619029 = r619026 / r619028;
        double r619030 = r619020 + r619029;
        double r619031 = -2.1826761238500875e-243;
        bool r619032 = r619030 <= r619031;
        double r619033 = 1.0;
        double r619034 = r619028 / r619025;
        double r619035 = r619034 / r619022;
        double r619036 = r619033 / r619035;
        double r619037 = r619020 + r619036;
        double r619038 = 0.0;
        bool r619039 = r619030 <= r619038;
        double r619040 = r619020 * r619023;
        double r619041 = r619040 / r619024;
        double r619042 = r619021 + r619041;
        double r619043 = r619023 * r619021;
        double r619044 = r619043 / r619024;
        double r619045 = r619042 - r619044;
        double r619046 = cbrt(r619022);
        double r619047 = cbrt(r619028);
        double r619048 = r619047 * r619047;
        double r619049 = r619048 / r619046;
        double r619050 = r619046 / r619049;
        double r619051 = r619047 / r619025;
        double r619052 = r619046 / r619051;
        double r619053 = r619050 * r619052;
        double r619054 = r619020 + r619053;
        double r619055 = r619039 ? r619045 : r619054;
        double r619056 = r619032 ? r619037 : r619055;
        return r619056;
}

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

Original25.0
Target9.7
Herbie9.2
\[\begin{array}{l} \mathbf{if}\;a \lt -1.6153062845442575 \cdot 10^{-142}:\\ \;\;\;\;x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;a \lt 3.7744031700831742 \cdot 10^{-182}:\\ \;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if (+ x (/ (* (- y x) (- z t)) (- a t))) < -2.1826761238500875e-243

    1. Initial program 22.2

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

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}}\]
    4. Using strategy rm
    5. Applied clear-num7.8

      \[\leadsto x + \color{blue}{\frac{1}{\frac{\frac{a - t}{z - t}}{y - x}}}\]

    if -2.1826761238500875e-243 < (+ x (/ (* (- y x) (- z t)) (- a t))) < 0.0

    1. Initial program 55.5

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

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

    if 0.0 < (+ x (/ (* (- y x) (- z t)) (- a t)))

    1. Initial program 21.6

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

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity7.6

      \[\leadsto x + \frac{y - x}{\frac{a - t}{\color{blue}{1 \cdot \left(z - t\right)}}}\]
    6. Applied add-cube-cbrt8.3

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

      \[\leadsto x + \frac{y - x}{\color{blue}{\frac{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}{1} \cdot \frac{\sqrt[3]{a - t}}{z - t}}}\]
    8. Applied add-cube-cbrt8.5

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

      \[\leadsto x + \color{blue}{\frac{\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}}{\frac{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}{1}} \cdot \frac{\sqrt[3]{y - x}}{\frac{\sqrt[3]{a - t}}{z - t}}}\]
    10. Simplified8.1

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

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

Reproduce

herbie shell --seed 2020081 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (if (< a -1.6153062845442575e-142) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t))))))

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