Average Error: 2.0 → 2.1
Time: 43.8s
Precision: 64
Internal precision: 128
\[\frac{x}{y} \cdot \left(z - t\right) + t\]
\[\left(\frac{x}{y} \cdot z + \frac{x}{y} \cdot \left(-t\right)\right) + t\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original2.0
Comparison2.3
Herbie2.1
\[ \begin{array}{l} \mathbf{if}\;z \lt 2.759456554562692 \cdot 10^{-282}:\\ \;\;\;\;\frac{x}{y} \cdot \left(z - t\right) + t\\ \mathbf{if}\;z \lt 2.326994450874436 \cdot 10^{-110}:\\ \;\;\;\;x \cdot \frac{z - t}{y} + t\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \left(z - t\right) + t\\ \end{array} \]

Derivation

  1. Initial program 2.0

    \[\frac{x}{y} \cdot \left(z - t\right) + t\]
  2. Using strategy rm
  3. Applied sub-neg 2.0

    \[\leadsto \frac{x}{y} \cdot \color{blue}{\left(z + \left(-t\right)\right)} + t\]
  4. Applied distribute-lft-in 2.1

    \[\leadsto \color{blue}{\left(\frac{x}{y} \cdot z + \frac{x}{y} \cdot \left(-t\right)\right)} + t\]
  5. Removed slow pow expressions

Runtime

Time bar (total: 43.8s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(4134991819 4004403003 2037120383 801980850 2949178599 3195044782)'
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"

  :target
  (if (< z 2.759456554562692e-282) (+ (* (/ x y) (- z t)) t) (if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t)))

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