Average Error: 14.8 → 10.2
Time: 4.9s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -9.88656814146117223 \cdot 10^{-154} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 4.73247773315875748 \cdot 10^{-210}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \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}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -9.88656814146117223 \cdot 10^{-154} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 4.73247773315875748 \cdot 10^{-210}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\

\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 r92338 = x;
        double r92339 = y;
        double r92340 = z;
        double r92341 = r92339 - r92340;
        double r92342 = t;
        double r92343 = r92342 - r92338;
        double r92344 = a;
        double r92345 = r92344 - r92340;
        double r92346 = r92343 / r92345;
        double r92347 = r92341 * r92346;
        double r92348 = r92338 + r92347;
        return r92348;
}

double f(double x, double y, double z, double t, double a) {
        double r92349 = x;
        double r92350 = y;
        double r92351 = z;
        double r92352 = r92350 - r92351;
        double r92353 = t;
        double r92354 = r92353 - r92349;
        double r92355 = a;
        double r92356 = r92355 - r92351;
        double r92357 = r92354 / r92356;
        double r92358 = r92352 * r92357;
        double r92359 = r92349 + r92358;
        double r92360 = -9.886568141461172e-154;
        bool r92361 = r92359 <= r92360;
        double r92362 = 4.7324777331587575e-210;
        bool r92363 = r92359 <= r92362;
        double r92364 = !r92363;
        bool r92365 = r92361 || r92364;
        double r92366 = r92349 / r92351;
        double r92367 = r92353 / r92351;
        double r92368 = r92366 - r92367;
        double r92369 = fma(r92350, r92368, r92353);
        double r92370 = r92365 ? r92359 : r92369;
        return r92370;
}

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 (+ x (* (- y z) (/ (- t x) (- a z)))) < -9.886568141461172e-154 or 4.7324777331587575e-210 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 6.1

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

    if -9.886568141461172e-154 < (+ x (* (- y z) (/ (- t x) (- a z)))) < 4.7324777331587575e-210

    1. Initial program 50.4

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -9.88656814146117223 \cdot 10^{-154} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 4.73247773315875748 \cdot 10^{-210}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020060 +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)))))