Average Error: 15.3 → 0.0
Time: 9.6s
Precision: 64
Internal precision: 128
\[\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

Original15.3
Comparison0.0
Herbie0.0
\[ \frac{0.5}{x} + \frac{0.5}{y} \]

Derivation

  1. Initial program 15.3

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

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

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

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

Runtime

Time bar (total: 9.6s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(1674937397 3440790997 3358467288 1510637231 4039448255 841317857)'
(FPCore (x y)
  :name "Linear.Projection:inversePerspective from linear-1.19.1.3, C"

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

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