Average Error: 15.2 → 7.2
Time: 5.6s
Precision: binary64
\[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 -8.99956326983425316 \cdot 10^{-292} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 0.0\right):\\ \;\;\;\;\left(x + t \cdot \frac{y - z}{a - z}\right) + \frac{y - z}{a - z} \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \end{array}\]

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)))) < -8.99956326983425316e-292 or 0.0 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 7.6

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
    2. Using strategy rm
    3. Applied clear-num7.9

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{1}{\frac{a - z}{t - x}}}\]
    4. Using strategy rm
    5. Applied associate-/r/7.7

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

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

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

      \[\leadsto x + \frac{y - z}{a - z} \cdot \color{blue}{\left(t + \left(-x\right)\right)}\]
    10. Applied distribute-lft-in4.3

      \[\leadsto x + \color{blue}{\left(\frac{y - z}{a - z} \cdot t + \frac{y - z}{a - z} \cdot \left(-x\right)\right)}\]
    11. Applied associate-+r+4.3

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

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

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

    1. Initial program 61.0

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
    2. Taylor expanded around inf 24.8

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -8.99956326983425316 \cdot 10^{-292} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 0.0\right):\\ \;\;\;\;\left(x + t \cdot \frac{y - z}{a - z}\right) + \frac{y - z}{a - z} \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 2020152 
(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)))))