Average Error: 9.5 → 0.1
Time: 34.2s
Precision: 64
Internal precision: 128
\[\frac{x}{y} + \frac{2.0 + \left(z \cdot 2.0\right) \cdot \left(1.0 - t\right)}{t \cdot z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -5.070143915338624 \cdot 10^{-32}:\\ \;\;\;\;\frac{{\left(\frac{2.0}{z}\right)}^2 - {2.0}^2}{t \cdot \left(\frac{2.0}{z} - 2.0\right)} - \left(2.0 - \frac{x}{y}\right)\\ \mathbf{if}\;z \le 9.246126022216187 \cdot 10^{-153}:\\ \;\;\;\;\frac{x}{y} + \frac{2.0 + \left(z \cdot 2.0\right) \cdot \left(1.0 - t\right)}{t \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{2.0}{z}\right)}^2 - {2.0}^2}{t \cdot \left(\frac{2.0}{z} - 2.0\right)} - \left(2.0 - \frac{x}{y}\right)\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original9.5
Comparison0.1
Herbie0.1
\[ \frac{\frac{2.0}{z} + 2.0}{t} - \left(2.0 - \frac{x}{y}\right) \]

Derivation

  1. Split input into 2 regimes.
  2. if z < -5.070143915338624e-32 or 9.246126022216187e-153 < z

    1. Initial program 13.2

      \[\frac{x}{y} + \frac{2.0 + \left(z \cdot 2.0\right) \cdot \left(1.0 - t\right)}{t \cdot z}\]
    2. Applied taylor 0.0

      \[\leadsto \frac{x}{y} + \left(\left(2.0 \cdot \frac{1}{t} + 2.0 \cdot \frac{1}{t \cdot z}\right) - 2.0\right)\]
    3. Taylor expanded around 0 0.0

      \[\leadsto \frac{x}{y} + \color{blue}{\left(\left(2.0 \cdot \frac{1}{t} + 2.0 \cdot \frac{1}{t \cdot z}\right) - 2.0\right)}\]
    4. Applied simplify 0.0

      \[\leadsto \color{blue}{\frac{\frac{2.0}{z} + 2.0}{t} - \left(2.0 - \frac{x}{y}\right)}\]
    5. Using strategy rm
    6. Applied flip-+ 0.0

      \[\leadsto \frac{\color{blue}{\frac{{\left(\frac{2.0}{z}\right)}^2 - {2.0}^2}{\frac{2.0}{z} - 2.0}}}{t} - \left(2.0 - \frac{x}{y}\right)\]
    7. Applied associate-/l/ 0.1

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

    if -5.070143915338624e-32 < z < 9.246126022216187e-153

    1. Initial program 0.2

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

Runtime

Time bar (total: 34.2s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(3458829069 2671581822 1264888354 3098179637 198302602 327550699)'
(FPCore (x y z t)
  :name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"

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

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