Average Error: 14.6 → 11.2
Time: 5.7s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -4.88445253498153072 \cdot 10^{153}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \mathbf{elif}\;z \le -4.441653635190891 \cdot 10^{-13}:\\ \;\;\;\;x + \left(y - z\right) \cdot \left(\left(t - x\right) \cdot \frac{1}{a - z}\right)\\ \mathbf{elif}\;z \le -6.97896161274890312 \cdot 10^{-229}:\\ \;\;\;\;x + \left(\left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right) \cdot \left(y - z\right)\right) \cdot \frac{\sqrt[3]{t - x}}{a - z}\\ \mathbf{elif}\;z \le 4.47537932662765098 \cdot 10^{212}:\\ \;\;\;\;x + \left(y - z\right) \cdot \left(\left(t - x\right) \cdot \frac{1}{a - z}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;z \le -4.88445253498153072 \cdot 10^{153}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\

\mathbf{elif}\;z \le -4.441653635190891 \cdot 10^{-13}:\\
\;\;\;\;x + \left(y - z\right) \cdot \left(\left(t - x\right) \cdot \frac{1}{a - z}\right)\\

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

\mathbf{elif}\;z \le 4.47537932662765098 \cdot 10^{212}:\\
\;\;\;\;x + \left(y - z\right) \cdot \left(\left(t - x\right) \cdot \frac{1}{a - z}\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r191249 = x;
        double r191250 = y;
        double r191251 = z;
        double r191252 = r191250 - r191251;
        double r191253 = t;
        double r191254 = r191253 - r191249;
        double r191255 = a;
        double r191256 = r191255 - r191251;
        double r191257 = r191254 / r191256;
        double r191258 = r191252 * r191257;
        double r191259 = r191249 + r191258;
        return r191259;
}

double f(double x, double y, double z, double t, double a) {
        double r191260 = z;
        double r191261 = -4.884452534981531e+153;
        bool r191262 = r191260 <= r191261;
        double r191263 = y;
        double r191264 = x;
        double r191265 = r191264 / r191260;
        double r191266 = t;
        double r191267 = r191266 / r191260;
        double r191268 = r191265 - r191267;
        double r191269 = fma(r191263, r191268, r191266);
        double r191270 = -4.441653635190891e-13;
        bool r191271 = r191260 <= r191270;
        double r191272 = r191263 - r191260;
        double r191273 = r191266 - r191264;
        double r191274 = 1.0;
        double r191275 = a;
        double r191276 = r191275 - r191260;
        double r191277 = r191274 / r191276;
        double r191278 = r191273 * r191277;
        double r191279 = r191272 * r191278;
        double r191280 = r191264 + r191279;
        double r191281 = -6.978961612748903e-229;
        bool r191282 = r191260 <= r191281;
        double r191283 = cbrt(r191273);
        double r191284 = r191283 * r191283;
        double r191285 = r191284 * r191272;
        double r191286 = r191283 / r191276;
        double r191287 = r191285 * r191286;
        double r191288 = r191264 + r191287;
        double r191289 = 4.475379326627651e+212;
        bool r191290 = r191260 <= r191289;
        double r191291 = r191290 ? r191280 : r191269;
        double r191292 = r191282 ? r191288 : r191291;
        double r191293 = r191271 ? r191280 : r191292;
        double r191294 = r191262 ? r191269 : r191293;
        return r191294;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Derivation

  1. Split input into 3 regimes
  2. if z < -4.884452534981531e+153 or 4.475379326627651e+212 < z

    1. Initial program 28.9

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

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

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

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

    if -4.884452534981531e+153 < z < -4.441653635190891e-13 or -6.978961612748903e-229 < z < 4.475379326627651e+212

    1. Initial program 10.9

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
    2. Using strategy rm
    3. Applied div-inv10.9

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

    if -4.441653635190891e-13 < z < -6.978961612748903e-229

    1. Initial program 7.2

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

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

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

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(\frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{1} \cdot \frac{\sqrt[3]{t - x}}{a - z}\right)}\]
    6. Applied associate-*r*6.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -4.88445253498153072 \cdot 10^{153}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \mathbf{elif}\;z \le -4.441653635190891 \cdot 10^{-13}:\\ \;\;\;\;x + \left(y - z\right) \cdot \left(\left(t - x\right) \cdot \frac{1}{a - z}\right)\\ \mathbf{elif}\;z \le -6.97896161274890312 \cdot 10^{-229}:\\ \;\;\;\;x + \left(\left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right) \cdot \left(y - z\right)\right) \cdot \frac{\sqrt[3]{t - x}}{a - z}\\ \mathbf{elif}\;z \le 4.47537932662765098 \cdot 10^{212}:\\ \;\;\;\;x + \left(y - z\right) \cdot \left(\left(t - x\right) \cdot \frac{1}{a - z}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020081 +o rules:numerics
(FPCore (x y z t a)
  :name "Numeric.Signal:interpolate   from hsignal-0.2.7.1"
  :precision binary64
  (+ x (* (- y z) (/ (- t x) (- a z)))))