Average Error: 14.7 → 12.0
Time: 14.7s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -9.021302549266581243760238270844575650835 \cdot 10^{-90} \lor \neg \left(a \le -3.879002027665169454260203007419150449317 \cdot 10^{-288}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}, \frac{t - x}{\sqrt[3]{a - z}}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -9.021302549266581243760238270844575650835 \cdot 10^{-90} \lor \neg \left(a \le -3.879002027665169454260203007419150449317 \cdot 10^{-288}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}, \frac{t - x}{\sqrt[3]{a - z}}, x\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r123783 = x;
        double r123784 = y;
        double r123785 = z;
        double r123786 = r123784 - r123785;
        double r123787 = t;
        double r123788 = r123787 - r123783;
        double r123789 = a;
        double r123790 = r123789 - r123785;
        double r123791 = r123788 / r123790;
        double r123792 = r123786 * r123791;
        double r123793 = r123783 + r123792;
        return r123793;
}

double f(double x, double y, double z, double t, double a) {
        double r123794 = a;
        double r123795 = -9.021302549266581e-90;
        bool r123796 = r123794 <= r123795;
        double r123797 = -3.8790020276651695e-288;
        bool r123798 = r123794 <= r123797;
        double r123799 = !r123798;
        bool r123800 = r123796 || r123799;
        double r123801 = y;
        double r123802 = z;
        double r123803 = r123801 - r123802;
        double r123804 = r123794 - r123802;
        double r123805 = cbrt(r123804);
        double r123806 = r123805 * r123805;
        double r123807 = r123803 / r123806;
        double r123808 = t;
        double r123809 = x;
        double r123810 = r123808 - r123809;
        double r123811 = r123810 / r123805;
        double r123812 = fma(r123807, r123811, r123809);
        double r123813 = r123809 / r123802;
        double r123814 = r123808 * r123801;
        double r123815 = r123814 / r123802;
        double r123816 = r123808 - r123815;
        double r123817 = fma(r123813, r123801, r123816);
        double r123818 = r123800 ? r123812 : r123817;
        return r123818;
}

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 < -9.021302549266581e-90 or -3.8790020276651695e-288 < a

    1. Initial program 13.0

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

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

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

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

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} + x\]
    8. Using strategy rm
    9. Applied add-cube-cbrt13.5

      \[\leadsto \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}}} + x\]
    10. Applied *-un-lft-identity13.5

      \[\leadsto \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}} + x\]
    11. Applied times-frac13.5

      \[\leadsto \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)} + x\]
    12. Applied associate-*r*11.0

      \[\leadsto \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}}} + x\]
    13. Simplified11.0

      \[\leadsto \color{blue}{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \frac{t - x}{\sqrt[3]{a - z}} + x\]
    14. Using strategy rm
    15. Applied fma-def11.0

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

    if -9.021302549266581e-90 < a < -3.8790020276651695e-288

    1. Initial program 24.7

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

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

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

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

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} + x\]
    8. Taylor expanded around inf 19.0

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

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

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

Reproduce

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