Average Error: 0.0 → 0.0
Time: 5.8s
Precision: 64
Internal precision: 384
\[\begin{array}{l} \mathbf{if}\;x \lt 10^{-05}:\\ \;\;\;\;1 + 0.5 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\sqrt{1 + x}\\ \end{array}\]
\[\begin{array}{l} \mathbf{if}\;x \lt 10^{-05}:\\ \;\;\;\;1 + 0.5 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{{\left(\sqrt{1 + x}\right)}^3}\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[\begin{array}{l} \mathbf{if}\;x \lt 10^{-05}:\\ \;\;\;\;1 + 0.5 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\sqrt{1 + x}\\ \end{array}\]
  2. Using strategy rm
  3. Applied add-cbrt-cube 0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \lt 10^{-05}:\\ \;\;\;\;1 + 0.5 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{{\left(\sqrt{1 + x}\right)}^3}\\ \end{array}\]
  4. Removed slow pow expressions

Runtime

Time bar (total: 5.8s) Debug log

Please include this information when filing a bug report:

herbie shell --seed '#(3052192724 3812927732 3686175817 630908657 2373248591 511094450)'
(FPCore (x)
  :name "squareRoot3"
  :pre (< 0 x 10)
  (if (< x 1e-05) (+ 1 (* 0.5 x)) (sqrt (+ 1 x))))