Average Error: 14.9 → 11.8
Time: 10.0s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -6.89686633134571 \cdot 10^{-195}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\ \mathbf{elif}\;a \le 1.5053374860442935 \cdot 10^{-158}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t}{\frac{z}{y}}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -6.89686633134571 \cdot 10^{-195}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r1739271 = x;
        double r1739272 = y;
        double r1739273 = z;
        double r1739274 = r1739272 - r1739273;
        double r1739275 = t;
        double r1739276 = r1739275 - r1739271;
        double r1739277 = a;
        double r1739278 = r1739277 - r1739273;
        double r1739279 = r1739276 / r1739278;
        double r1739280 = r1739274 * r1739279;
        double r1739281 = r1739271 + r1739280;
        return r1739281;
}

double f(double x, double y, double z, double t, double a) {
        double r1739282 = a;
        double r1739283 = -6.89686633134571e-195;
        bool r1739284 = r1739282 <= r1739283;
        double r1739285 = y;
        double r1739286 = z;
        double r1739287 = r1739285 - r1739286;
        double r1739288 = t;
        double r1739289 = x;
        double r1739290 = r1739288 - r1739289;
        double r1739291 = r1739282 - r1739286;
        double r1739292 = r1739290 / r1739291;
        double r1739293 = fma(r1739287, r1739292, r1739289);
        double r1739294 = 1.5053374860442935e-158;
        bool r1739295 = r1739282 <= r1739294;
        double r1739296 = r1739289 / r1739286;
        double r1739297 = r1739286 / r1739285;
        double r1739298 = r1739288 / r1739297;
        double r1739299 = r1739288 - r1739298;
        double r1739300 = fma(r1739296, r1739285, r1739299);
        double r1739301 = r1739295 ? r1739300 : r1739293;
        double r1739302 = r1739284 ? r1739293 : r1739301;
        return r1739302;
}

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 2 regimes
  2. if a < -6.89686633134571e-195 or 1.5053374860442935e-158 < a

    1. Initial program 12.6

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

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

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\left(t - x\right) \cdot \frac{1}{a - z}}, x\right)\]
    5. Using strategy rm
    6. Applied un-div-inv12.5

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

    if -6.89686633134571e-195 < a < 1.5053374860442935e-158

    1. Initial program 25.1

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t}{\frac{z}{y}}\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification11.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -6.89686633134571 \cdot 10^{-195}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\ \mathbf{elif}\;a \le 1.5053374860442935 \cdot 10^{-158}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t}{\frac{z}{y}}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\ \end{array}\]

Reproduce

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