Average Error: 14.7 → 10.3
Time: 22.0s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -3.13107925058597985413822402752417052196 \cdot 10^{-143}:\\ \;\;\;\;\frac{t - x}{\frac{a - z}{y - z}} + x\\ \mathbf{elif}\;a \le 7.28029464857505619204211631424061735688 \cdot 10^{-190}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\ \mathbf{elif}\;a \le 7.107129072265313001450412102042228771063 \cdot 10^{-32}:\\ \;\;\;\;\frac{y - z}{a - z} \cdot \left(t - x\right) + x\\ \mathbf{elif}\;a \le 7.829350447579144764528227594397742646553 \cdot 10^{-17}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t - x}{\frac{a - z}{y - z}} + x\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -3.13107925058597985413822402752417052196 \cdot 10^{-143}:\\
\;\;\;\;\frac{t - x}{\frac{a - z}{y - z}} + x\\

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

\mathbf{elif}\;a \le 7.107129072265313001450412102042228771063 \cdot 10^{-32}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot \left(t - x\right) + x\\

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

\mathbf{else}:\\
\;\;\;\;\frac{t - x}{\frac{a - z}{y - z}} + x\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r71752 = x;
        double r71753 = y;
        double r71754 = z;
        double r71755 = r71753 - r71754;
        double r71756 = t;
        double r71757 = r71756 - r71752;
        double r71758 = a;
        double r71759 = r71758 - r71754;
        double r71760 = r71757 / r71759;
        double r71761 = r71755 * r71760;
        double r71762 = r71752 + r71761;
        return r71762;
}

double f(double x, double y, double z, double t, double a) {
        double r71763 = a;
        double r71764 = -3.13107925058598e-143;
        bool r71765 = r71763 <= r71764;
        double r71766 = t;
        double r71767 = x;
        double r71768 = r71766 - r71767;
        double r71769 = z;
        double r71770 = r71763 - r71769;
        double r71771 = y;
        double r71772 = r71771 - r71769;
        double r71773 = r71770 / r71772;
        double r71774 = r71768 / r71773;
        double r71775 = r71774 + r71767;
        double r71776 = 7.280294648575056e-190;
        bool r71777 = r71763 <= r71776;
        double r71778 = r71767 / r71769;
        double r71779 = r71766 * r71771;
        double r71780 = r71779 / r71769;
        double r71781 = r71766 - r71780;
        double r71782 = fma(r71778, r71771, r71781);
        double r71783 = 7.107129072265313e-32;
        bool r71784 = r71763 <= r71783;
        double r71785 = r71772 / r71770;
        double r71786 = r71785 * r71768;
        double r71787 = r71786 + r71767;
        double r71788 = 7.829350447579145e-17;
        bool r71789 = r71763 <= r71788;
        double r71790 = r71789 ? r71782 : r71775;
        double r71791 = r71784 ? r71787 : r71790;
        double r71792 = r71777 ? r71782 : r71791;
        double r71793 = r71765 ? r71775 : r71792;
        return r71793;
}

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 a < -3.13107925058598e-143 or 7.829350447579145e-17 < a

    1. Initial program 10.5

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

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

      \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(y - z\right) + x}\]
    5. Using strategy rm
    6. Applied div-inv10.6

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

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

      \[\leadsto \left(t - x\right) \cdot \color{blue}{\frac{y - z}{a - z}} + x\]
    9. Using strategy rm
    10. Applied clear-num8.4

      \[\leadsto \left(t - x\right) \cdot \color{blue}{\frac{1}{\frac{a - z}{y - z}}} + x\]
    11. Using strategy rm
    12. Applied *-un-lft-identity8.4

      \[\leadsto \color{blue}{\left(1 \cdot \left(t - x\right)\right)} \cdot \frac{1}{\frac{a - z}{y - z}} + x\]
    13. Applied associate-*l*8.4

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

      \[\leadsto 1 \cdot \color{blue}{\frac{t - x}{\frac{a - z}{y - z}}} + x\]

    if -3.13107925058598e-143 < a < 7.280294648575056e-190 or 7.107129072265313e-32 < a < 7.829350447579145e-17

    1. Initial program 25.3

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

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

      \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(y - z\right) + x}\]
    5. Using strategy rm
    6. Applied div-inv25.3

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

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

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

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

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

    if 7.280294648575056e-190 < a < 7.107129072265313e-32

    1. Initial program 19.5

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

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

      \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(y - z\right) + x}\]
    5. Using strategy rm
    6. Applied div-inv19.6

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

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

      \[\leadsto \left(t - x\right) \cdot \color{blue}{\frac{y - z}{a - z}} + x\]
    9. Using strategy rm
    10. Applied clear-num16.0

      \[\leadsto \left(t - x\right) \cdot \color{blue}{\frac{1}{\frac{a - z}{y - z}}} + x\]
    11. Using strategy rm
    12. Applied *-un-lft-identity16.0

      \[\leadsto \left(t - x\right) \cdot \frac{1}{\frac{a - z}{\color{blue}{1 \cdot \left(y - z\right)}}} + x\]
    13. Applied *-un-lft-identity16.0

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

      \[\leadsto \left(t - x\right) \cdot \frac{1}{\color{blue}{\frac{1}{1} \cdot \frac{a - z}{y - z}}} + x\]
    15. Applied add-cube-cbrt16.0

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

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

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

      \[\leadsto \left(t - x\right) \cdot \left(1 \cdot \color{blue}{\frac{y - z}{a - z}}\right) + x\]
  3. Recombined 3 regimes into one program.
  4. Final simplification10.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -3.13107925058597985413822402752417052196 \cdot 10^{-143}:\\ \;\;\;\;\frac{t - x}{\frac{a - z}{y - z}} + x\\ \mathbf{elif}\;a \le 7.28029464857505619204211631424061735688 \cdot 10^{-190}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\ \mathbf{elif}\;a \le 7.107129072265313001450412102042228771063 \cdot 10^{-32}:\\ \;\;\;\;\frac{y - z}{a - z} \cdot \left(t - x\right) + x\\ \mathbf{elif}\;a \le 7.829350447579144764528227594397742646553 \cdot 10^{-17}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t - x}{\frac{a - z}{y - z}} + x\\ \end{array}\]

Reproduce

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