Average Error: 4.8 → 0.1
Time: 2.0s
Precision: binary64
\[\frac{x}{y \cdot y} - 3\]
\[\frac{\frac{x}{y}}{y} - 3\]
\frac{x}{y \cdot y} - 3
\frac{\frac{x}{y}}{y} - 3
(FPCore (x y) :precision binary64 (- (/ x (* y y)) 3.0))
(FPCore (x y) :precision binary64 (- (/ (/ x y) y) 3.0))
double code(double x, double y) {
	return (x / (y * y)) - 3.0;
}
double code(double x, double y) {
	return ((x / y) / y) - 3.0;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original4.8
Target0.1
Herbie0.1
\[\frac{\frac{x}{y}}{y} - 3\]

Derivation

  1. Initial program 4.8

    \[\frac{x}{y \cdot y} - 3\]
  2. Using strategy rm
  3. Applied associate-/r*_binary640.1

    \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y}} - 3\]
  4. Final simplification0.1

    \[\leadsto \frac{\frac{x}{y}}{y} - 3\]

Reproduce

herbie shell --seed 2020232 
(FPCore (x y)
  :name "Statistics.Sample:$skurtosis from math-functions-0.1.5.2"
  :precision binary64

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

  (- (/ x (* y y)) 3.0))