Average Error: 24.9 → 11.0
Time: 57.9s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.1505776834338363 \cdot 10^{+228}:\\ \;\;\;\;\frac{x}{\frac{t}{z}} - \left(\frac{y}{\frac{t}{z}} - y\right)\\ \mathbf{elif}\;t \le -3.101992109502826 \cdot 10^{+145}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z - t}{\sqrt[3]{a - t}} \cdot \frac{1}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}, y - x, x\right)\\ \mathbf{elif}\;t \le -1.142451209668467 \cdot 10^{+56}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y\right) - \frac{z}{t} \cdot y\\ \mathbf{elif}\;t \le 1.6000865785138779 \cdot 10^{+168}:\\ \;\;\;\;x + \left(\frac{\sqrt[3]{z - t}}{a - t} \cdot \left(\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}\right)\right) \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y\right) - \frac{z}{t} \cdot y\\ \end{array}\]
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;t \le -1.1505776834338363 \cdot 10^{+228}:\\
\;\;\;\;\frac{x}{\frac{t}{z}} - \left(\frac{y}{\frac{t}{z}} - y\right)\\

\mathbf{elif}\;t \le -3.101992109502826 \cdot 10^{+145}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{\sqrt[3]{a - t}} \cdot \frac{1}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}, y - x, x\right)\\

\mathbf{elif}\;t \le -1.142451209668467 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y\right) - \frac{z}{t} \cdot y\\

\mathbf{elif}\;t \le 1.6000865785138779 \cdot 10^{+168}:\\
\;\;\;\;x + \left(\frac{\sqrt[3]{z - t}}{a - t} \cdot \left(\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}\right)\right) \cdot \left(y - x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y\right) - \frac{z}{t} \cdot y\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r20417115 = x;
        double r20417116 = y;
        double r20417117 = r20417116 - r20417115;
        double r20417118 = z;
        double r20417119 = t;
        double r20417120 = r20417118 - r20417119;
        double r20417121 = r20417117 * r20417120;
        double r20417122 = a;
        double r20417123 = r20417122 - r20417119;
        double r20417124 = r20417121 / r20417123;
        double r20417125 = r20417115 + r20417124;
        return r20417125;
}

double f(double x, double y, double z, double t, double a) {
        double r20417126 = t;
        double r20417127 = -1.1505776834338363e+228;
        bool r20417128 = r20417126 <= r20417127;
        double r20417129 = x;
        double r20417130 = z;
        double r20417131 = r20417126 / r20417130;
        double r20417132 = r20417129 / r20417131;
        double r20417133 = y;
        double r20417134 = r20417133 / r20417131;
        double r20417135 = r20417134 - r20417133;
        double r20417136 = r20417132 - r20417135;
        double r20417137 = -3.101992109502826e+145;
        bool r20417138 = r20417126 <= r20417137;
        double r20417139 = r20417130 - r20417126;
        double r20417140 = a;
        double r20417141 = r20417140 - r20417126;
        double r20417142 = cbrt(r20417141);
        double r20417143 = r20417139 / r20417142;
        double r20417144 = 1.0;
        double r20417145 = r20417142 * r20417142;
        double r20417146 = r20417144 / r20417145;
        double r20417147 = r20417143 * r20417146;
        double r20417148 = r20417133 - r20417129;
        double r20417149 = fma(r20417147, r20417148, r20417129);
        double r20417150 = -1.142451209668467e+56;
        bool r20417151 = r20417126 <= r20417150;
        double r20417152 = r20417129 / r20417126;
        double r20417153 = fma(r20417152, r20417130, r20417133);
        double r20417154 = r20417130 / r20417126;
        double r20417155 = r20417154 * r20417133;
        double r20417156 = r20417153 - r20417155;
        double r20417157 = 1.6000865785138779e+168;
        bool r20417158 = r20417126 <= r20417157;
        double r20417159 = cbrt(r20417139);
        double r20417160 = r20417159 / r20417141;
        double r20417161 = r20417159 * r20417159;
        double r20417162 = r20417160 * r20417161;
        double r20417163 = r20417162 * r20417148;
        double r20417164 = r20417129 + r20417163;
        double r20417165 = r20417158 ? r20417164 : r20417156;
        double r20417166 = r20417151 ? r20417156 : r20417165;
        double r20417167 = r20417138 ? r20417149 : r20417166;
        double r20417168 = r20417128 ? r20417136 : r20417167;
        return r20417168;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Target

Original24.9
Target9.1
Herbie11.0
\[\begin{array}{l} \mathbf{if}\;a \lt -1.6153062845442575 \cdot 10^{-142}:\\ \;\;\;\;x + \frac{y - x}{1.0} \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;a \lt 3.774403170083174 \cdot 10^{-182}:\\ \;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{1.0} \cdot \frac{z - t}{a - t}\\ \end{array}\]

Derivation

  1. Split input into 4 regimes
  2. if t < -1.1505776834338363e+228

    1. Initial program 49.8

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)}\]
    3. Taylor expanded around inf 23.6

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

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

    if -1.1505776834338363e+228 < t < -3.101992109502826e+145

    1. Initial program 44.9

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt19.9

      \[\leadsto \mathsf{fma}\left(\frac{z - t}{\color{blue}{\left(\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}\right) \cdot \sqrt[3]{a - t}}}, y - x, x\right)\]
    5. Applied *-un-lft-identity19.9

      \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{1 \cdot \left(z - t\right)}}{\left(\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}\right) \cdot \sqrt[3]{a - t}}, y - x, x\right)\]
    6. Applied times-frac19.9

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

    if -3.101992109502826e+145 < t < -1.142451209668467e+56 or 1.6000865785138779e+168 < t

    1. Initial program 42.0

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)}\]
    3. Using strategy rm
    4. Applied fma-udef19.3

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

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

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

    if -1.142451209668467e+56 < t < 1.6000865785138779e+168

    1. Initial program 14.2

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)}\]
    3. Using strategy rm
    4. Applied fma-udef6.5

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.1505776834338363 \cdot 10^{+228}:\\ \;\;\;\;\frac{x}{\frac{t}{z}} - \left(\frac{y}{\frac{t}{z}} - y\right)\\ \mathbf{elif}\;t \le -3.101992109502826 \cdot 10^{+145}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z - t}{\sqrt[3]{a - t}} \cdot \frac{1}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}, y - x, x\right)\\ \mathbf{elif}\;t \le -1.142451209668467 \cdot 10^{+56}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y\right) - \frac{z}{t} \cdot y\\ \mathbf{elif}\;t \le 1.6000865785138779 \cdot 10^{+168}:\\ \;\;\;\;x + \left(\frac{\sqrt[3]{z - t}}{a - t} \cdot \left(\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}\right)\right) \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y\right) - \frac{z}{t} \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2019165 +o rules:numerics
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"

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

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