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

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

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}{y} - 0.5 \cdot \frac{1}{x}\]
  3. Taylor expanded around 0 0.0

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

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

Runtime

Time bar (total: 10.7s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(3067140280 3718379749 3681175777 4165576500 1128393785 2117257760)'
(FPCore (x y)
  :name "Linear.Projection:inversePerspective from linear-1.19.1.3, B"

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

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