Average Error: 2.3 → 2.0
Time: 37.2s
Precision: 64
Internal precision: 128
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \cdot t \le -6.607091110953482 \cdot 10^{-14}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \mathbf{if}\;\frac{x - y}{z - y} \cdot t \le 2.5719851404145336 \cdot 10^{-248}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original2.3
Comparison2.2
Herbie2.0
\[ \frac{t}{\frac{z - y}{x - y}} \]

Derivation

  1. Split input into 3 regimes.
  2. if (* (/ (- x y) (- z y)) t) < -6.607091110953482e-14

    1. Initial program 2.8

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied div-inv 2.9

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \left(\frac{1}{z - y} \cdot t\right)}\]
    5. Applied simplify 2.4

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

    if -6.607091110953482e-14 < (* (/ (- x y) (- z y)) t) < 2.5719851404145336e-248

    1. Initial program 2.7

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied associate-*l/ 2.3

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

    if 2.5719851404145336e-248 < (* (/ (- x y) (- z y)) t)

    1. Initial program 1.6

      \[\frac{x - y}{z - y} \cdot t\]
  3. Recombined 3 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 37.2s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(1806516843 71397366 2752149017 1663763 1918680773 1427670572)'
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"

  :target
  (/ t (/ (- z y) (- x y)))

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