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

Error

Bits error versus x

Bits error versus y

Target

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

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}{y} - \frac{0.5}{x}}\]
  4. Removed slow pow expressions.

Runtime

Time bar (total: 11.9s)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, B"

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

  (/ (- x y) (* (* x 2.0) y)))