Average Error: 15.1 → 11.9
Time: 6.1s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -2.72909184718930696180304451348657521234 \cdot 10^{115} \lor \neg \left(z \le 1.081364030966559256893817185140237473474 \cdot 10^{189}\right):\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right) \cdot \frac{\sqrt[3]{t - x}}{a - z}, x\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;z \le -2.72909184718930696180304451348657521234 \cdot 10^{115} \lor \neg \left(z \le 1.081364030966559256893817185140237473474 \cdot 10^{189}\right):\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r110606 = x;
        double r110607 = y;
        double r110608 = z;
        double r110609 = r110607 - r110608;
        double r110610 = t;
        double r110611 = r110610 - r110606;
        double r110612 = a;
        double r110613 = r110612 - r110608;
        double r110614 = r110611 / r110613;
        double r110615 = r110609 * r110614;
        double r110616 = r110606 + r110615;
        return r110616;
}

double f(double x, double y, double z, double t, double a) {
        double r110617 = z;
        double r110618 = -2.729091847189307e+115;
        bool r110619 = r110617 <= r110618;
        double r110620 = 1.0813640309665593e+189;
        bool r110621 = r110617 <= r110620;
        double r110622 = !r110621;
        bool r110623 = r110619 || r110622;
        double r110624 = y;
        double r110625 = x;
        double r110626 = r110625 / r110617;
        double r110627 = t;
        double r110628 = r110627 / r110617;
        double r110629 = r110626 - r110628;
        double r110630 = fma(r110624, r110629, r110627);
        double r110631 = r110624 - r110617;
        double r110632 = r110627 - r110625;
        double r110633 = cbrt(r110632);
        double r110634 = r110633 * r110633;
        double r110635 = a;
        double r110636 = r110635 - r110617;
        double r110637 = r110633 / r110636;
        double r110638 = r110634 * r110637;
        double r110639 = fma(r110631, r110638, r110625);
        double r110640 = r110623 ? r110630 : r110639;
        return r110640;
}

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 z < -2.729091847189307e+115 or 1.0813640309665593e+189 < z

    1. Initial program 28.4

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

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

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

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

    if -2.729091847189307e+115 < z < 1.0813640309665593e+189

    1. Initial program 9.8

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

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

      \[\leadsto \mathsf{fma}\left(y - z, \frac{t - x}{\color{blue}{1 \cdot \left(a - z\right)}}, x\right)\]
    5. Applied add-cube-cbrt10.3

      \[\leadsto \mathsf{fma}\left(y - z, \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)}, x\right)\]
    6. Applied times-frac10.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -2.72909184718930696180304451348657521234 \cdot 10^{115} \lor \neg \left(z \le 1.081364030966559256893817185140237473474 \cdot 10^{189}\right):\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right) \cdot \frac{\sqrt[3]{t - x}}{a - z}, x\right)\\ \end{array}\]

Reproduce

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