Average Error: 0.1 → 0.0
Time: 3.4s
Precision: 64
Internal precision: 128
\[\frac{x + y}{y + y}\]
\[\frac{1}{2} \cdot \frac{x}{y} + \frac{1}{2}\]

Error

Bits error versus x

Bits error versus y

Target

Original0.1
Comparison0.0
Herbie0.0
\[ \frac{1}{2} \cdot \frac{x}{y} + \frac{1}{2} \]

Derivation

  1. Initial program 0.1

    \[\frac{x + y}{y + y}\]
  2. Applied taylor 0.0

    \[\leadsto \frac{1}{2} \cdot \frac{x}{y} + \frac{1}{2}\]
  3. Taylor expanded around 0 0.0

    \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x}{y} + \frac{1}{2}}\]
  4. Removed slow pow expressions

Runtime

Time bar (total: 3.4s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(1979001117 2364323638 4035444083 2491739166 810373276 3751486815)'
(FPCore (x y)
  :name "Data.Random.Distribution.T:$ccdf from random-fu-0.2.6.2"

  :target
  (+ (* 1/2 (/ x y)) 1/2)

  (/ (+ x y) (+ y y)))