Average Error: 9.2 → 0.1
Time: 1.0m
Precision: 64
Internal Precision: 384
\[\frac{x}{y} + \frac{2.0 + \left(z \cdot 2.0\right) \cdot \left(1.0 - t\right)}{t \cdot z}\]
\[\frac{\frac{2.0}{z} + 2.0}{t} - \left(2.0 - \frac{x}{y}\right)\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

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

Derivation

  1. Initial program 9.2

    \[\frac{x}{y} + \frac{2.0 + \left(z \cdot 2.0\right) \cdot \left(1.0 - t\right)}{t \cdot z}\]
  2. Taylor expanded around 0 0.1

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

    \[\leadsto \color{blue}{\frac{\frac{2.0}{z} + 2.0}{t} - \left(2.0 - \frac{x}{y}\right)}\]
  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 "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"

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

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