Average Error: 14.8 → 8.3
Time: 25.0s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le -4.869256490744422113135847004017141833686 \cdot 10^{-232}:\\ \;\;\;\;x + \frac{t - x}{a - z} \cdot \left(y - z\right)\\ \mathbf{elif}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le 0.0:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t\right) - \frac{t}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le -4.869256490744422113135847004017141833686 \cdot 10^{-232}:\\
\;\;\;\;x + \frac{t - x}{a - z} \cdot \left(y - z\right)\\

\mathbf{elif}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le 0.0:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t\right) - \frac{t}{\frac{z}{y}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r4991603 = x;
        double r4991604 = y;
        double r4991605 = z;
        double r4991606 = r4991604 - r4991605;
        double r4991607 = t;
        double r4991608 = r4991607 - r4991603;
        double r4991609 = a;
        double r4991610 = r4991609 - r4991605;
        double r4991611 = r4991608 / r4991610;
        double r4991612 = r4991606 * r4991611;
        double r4991613 = r4991603 + r4991612;
        return r4991613;
}

double f(double x, double y, double z, double t, double a) {
        double r4991614 = x;
        double r4991615 = t;
        double r4991616 = r4991615 - r4991614;
        double r4991617 = a;
        double r4991618 = z;
        double r4991619 = r4991617 - r4991618;
        double r4991620 = r4991616 / r4991619;
        double r4991621 = y;
        double r4991622 = r4991621 - r4991618;
        double r4991623 = r4991620 * r4991622;
        double r4991624 = r4991614 + r4991623;
        double r4991625 = -4.869256490744422e-232;
        bool r4991626 = r4991624 <= r4991625;
        double r4991627 = 0.0;
        bool r4991628 = r4991624 <= r4991627;
        double r4991629 = r4991614 / r4991618;
        double r4991630 = fma(r4991629, r4991621, r4991615);
        double r4991631 = r4991618 / r4991621;
        double r4991632 = r4991615 / r4991631;
        double r4991633 = r4991630 - r4991632;
        double r4991634 = cbrt(r4991614);
        double r4991635 = r4991634 * r4991634;
        double r4991636 = cbrt(r4991619);
        double r4991637 = r4991636 * r4991636;
        double r4991638 = r4991622 / r4991637;
        double r4991639 = r4991616 / r4991636;
        double r4991640 = r4991638 * r4991639;
        double r4991641 = fma(r4991635, r4991634, r4991640);
        double r4991642 = r4991628 ? r4991633 : r4991641;
        double r4991643 = r4991626 ? r4991624 : r4991642;
        return r4991643;
}

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 (+ x (* (- y z) (/ (- t x) (- a z)))) < -4.869256490744422e-232

    1. Initial program 6.6

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

    if -4.869256490744422e-232 < (+ x (* (- y z) (/ (- t x) (- a z)))) < 0.0

    1. Initial program 57.9

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt57.7

      \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{\left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right) \cdot \sqrt[3]{a - z}}}\]
    4. Applied *-un-lft-identity57.7

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

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\]
    8. Taylor expanded around inf 26.3

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

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

    if 0.0 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 8.1

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt8.7

      \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{\left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right) \cdot \sqrt[3]{a - z}}}\]
    4. Applied *-un-lft-identity8.7

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

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\]
    8. Using strategy rm
    9. Applied add-cube-cbrt5.6

      \[\leadsto \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}} + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\]
    10. Applied fma-def5.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le -4.869256490744422113135847004017141833686 \cdot 10^{-232}:\\ \;\;\;\;x + \frac{t - x}{a - z} \cdot \left(y - z\right)\\ \mathbf{elif}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le 0.0:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t\right) - \frac{t}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\right)\\ \end{array}\]

Reproduce

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