Average Error: 14.7 → 0.0
Time: 1.2m
Precision: 64
Internal Precision: 384
\[\frac{x + y}{\left(x \cdot 2.0\right) \cdot y}\]
\[\frac{0.5}{x} + \frac{0.5}{y}\]

Error

Bits error versus x

Bits error versus y

Target

Original14.7
Target0.0
Herbie0.0
\[\frac{0.5}{x} + \frac{0.5}{y}\]

Derivation

  1. Initial program 14.7

    \[\frac{x + y}{\left(x \cdot 2.0\right) \cdot y}\]
  2. Taylor expanded around 0 0.0

    \[\leadsto \color{blue}{0.5 \cdot \frac{1}{y} + 0.5 \cdot \frac{1}{x}}\]
  3. Applied simplify0.0

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

Runtime

Time bar (total: 1.2m)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit +o reduce:binary-search
(FPCore (x y)
  :name "Linear.Projection:inversePerspective from linear-1.19.1.3, C"

  :herbie-target
  (+ (/ 0.5 x) (/ 0.5 y))

  (/ (+ x y) (* (* x 2.0) y)))