Average Error: 2.1 → 1.3
Time: 1.0m
Precision: 64
Internal Precision: 384
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \cdot t \le -9.854125768905 \cdot 10^{-316}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{if}\;\frac{x - y}{z - y} \cdot t \le -0.0:\\ \;\;\;\;\left(x - y\right) \cdot \frac{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.1
Target2.1
Herbie1.3
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 2 regimes
  2. if (* (/ (- x y) (- z y)) t) < -9.854125768905e-316 or -0.0 < (* (/ (- x y) (- z y)) t)

    1. Initial program 1.4

      \[\frac{x - y}{z - y} \cdot t\]

    if -9.854125768905e-316 < (* (/ (- x y) (- z y)) t) < -0.0

    1. Initial program 8.7

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

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

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

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

Runtime

Time bar (total: 1.0m)Debug log

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

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

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