Average Error: 31.2 → 0
Time: 13.2s
Precision: 64
Internal Precision: 1408
\[\frac{x}{x} - \frac{1}{x} \cdot \sqrt{x \cdot x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -6.5674181107811 \cdot 10^{-310}:\\ \;\;\;\;2\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if x < -6.5674181107811e-310

    1. Initial program 27.7

      \[\frac{x}{x} - \frac{1}{x} \cdot \sqrt{x \cdot x}\]
    2. Using strategy rm
    3. Applied gonzo-20

      \[\leadsto \color{blue}{2}\]

    if -6.5674181107811e-310 < x

    1. Initial program 34.8

      \[\frac{x}{x} - \frac{1}{x} \cdot \sqrt{x \cdot x}\]
    2. Using strategy rm
    3. Applied gonzo-00

      \[\leadsto \color{blue}{0}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 13.2s)Debug log

herbie shell --seed '#(428700651 1106906792 470491210 3500543625 1808163884 651714402)' -o rules:trigonometry -o setup:simplify -o generate:taylor -o generate:simplify
(FPCore (x)
  :name "zero or two"
  (- (/ x x) (* (/ 1 x) (sqrt (* x x)))))