Average Error: 0.6 → 0
Time: 821.0ms
Precision: binary64
Cost: 6528
\[\frac{1}{x \cdot x}\]
\[{x}^{-2}\]
\frac{1}{x \cdot x}
{x}^{-2}
(FPCore (x) :precision binary64 (/ 1.0 (* x x)))
(FPCore (x) :precision binary64 (pow x -2.0))
double code(double x) {
	return 1.0 / (x * x);
}
double code(double x) {
	return pow(x, -2.0);
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.6
Target0.2
Herbie0
\[\frac{\frac{1}{x}}{x}\]

Alternatives

Alternative 1
Error0.2
Cost320
\[\frac{\frac{1}{x}}{x}\]
Alternative 2
Error40.6
Cost706
\[\begin{array}{l} \mathbf{if}\;x \leq -9.559387912391021 \cdot 10^{+76}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 9.32495652245783 \cdot 10^{+76}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array}\]
Alternative 3
Error61.0
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.6

    \[\frac{1}{x \cdot x}\]
  2. Using strategy rm
  3. Applied pow2_binary64_131170.6

    \[\leadsto \frac{1}{\color{blue}{{x}^{2}}}\]
  4. Applied pow-flip_binary64_131100

    \[\leadsto \color{blue}{{x}^{\left(-2\right)}}\]
  5. Simplified0

    \[\leadsto {x}^{\color{blue}{-2}}\]
  6. Simplified0

    \[\leadsto \color{blue}{{x}^{-2}}\]
  7. Final simplification0

    \[\leadsto {x}^{-2}\]

Reproduce

herbie shell --seed 2021044 
(FPCore (x)
  :name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (/ (/ 1.0 x) x)

  (/ 1.0 (* x x)))