Average Error: 15.9 → 7.2
Time: 2.6m
Precision: 64
Internal Precision: 1920
\[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 -6.090130279416385 \cdot 10^{-196}:\\ \;\;\;\;x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\\ \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 4.7656810866124795 \cdot 10^{-307}:\\ \;\;\;\;t - \left(t - x\right) \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Target

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

Derivation

  1. Split input into 2 regimes
  2. if (+ x (* (- y z) (/ (- t x) (- a z)))) < -6.090130279416385e-196 or 4.7656810866124795e-307 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 7.2

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

      \[\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-identity7.9

      \[\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-frac7.9

      \[\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.3

      \[\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. Applied simplify5.3

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

    if -6.090130279416385e-196 < (+ x (* (- y z) (/ (- t x) (- a z)))) < 4.7656810866124795e-307

    1. Initial program 60.9

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

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

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

Runtime

Time bar (total: 2.6m)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit
(FPCore (x y z t a)
  :name "Numeric.Signal:interpolate   from hsignal-0.2.7.1"

  :herbie-target
  (+ x (* (- y z) (/ (- t x) (- a z))))

  (+ x (* (- y z) (/ (- t x) (- a z)))))