Average Error: 0.0 → 0
Time: 2.7s
Precision: 64
Internal precision: 128
\[x + \frac{y - x}{2.0}\]
\[\left(x + y\right) \cdot 0.5\]

Error

Bits error versus x

Bits error versus y

Target

Original0.0
Comparison0
Herbie0
\[ 0.5 \cdot \left(x + y\right) \]

Derivation

  1. Initial program 0.0

    \[x + \frac{y - x}{2.0}\]
  2. Applied taylor 0

    \[\leadsto 0.5 \cdot y + 0.5 \cdot x\]
  3. Taylor expanded around 0 0

    \[\leadsto \color{blue}{0.5 \cdot y + 0.5 \cdot x}\]
  4. Applied simplify 0

    \[\leadsto \color{blue}{\left(x + y\right) \cdot 0.5}\]
  5. Removed slow pow expressions

Runtime

Time bar (total: 2.7s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(2975985876 4226173628 1411809594 1501640525 1841205942 1902890052)'
(FPCore (x y)
  :name "Numeric.Interval.Internal:bisect from intervals-0.7.1, A"

  :target
  (* 0.5 (+ x y))

  (+ x (/ (- y x) 2.0)))