Average Error: 61.8 → 0.3
Time: 2.3s
Precision: binary64
\[\]
\[\]
\[\]
double code(double t) {
	return ((double) (((double) (((double) (1.0 + ((double) (t * 2e-16)))) * ((double) (1.0 + ((double) (t * 2e-16)))))) + ((double) (-1.0 - ((double) (2.0 * ((double) (t * 2e-16))))))));
}
double code(double t) {
	return ((double) (((double) sqrt(3.9999999999999997e-32)) * ((double) (t * ((double) (t * ((double) sqrt(3.9999999999999997e-32))))))));
}

Error

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original61.8
Target50.6
Herbie0.3
\[\]

Derivation

  1. Initial program 61.8

    \[\]
  2. Taylor expanded around 0 0.3

    \[\leadsto \]
  3. Simplified0.3

    \[\leadsto \]
  4. Using strategy rm
  5. Applied associate-*r*0.3

    \[\leadsto \]
  6. Using strategy rm
  7. Applied add-sqr-sqrt0.3

    \[\leadsto \]
  8. Applied associate-*r*0.3

    \[\leadsto \]
  9. Simplified0.3

    \[\leadsto \]
  10. Final simplification0.3

    \[\leadsto \]

Reproduce

herbie shell --seed 2020192 
(FPCore (t)
  :name "fma_test1"
  :precision binary64
  :pre (<= 0.9 t 1.1)

  :herbie-target
  (fma (+ 1.0 (* t 2e-16)) (+ 1.0 (* t 2e-16)) (- -1.0 (* 2.0 (* t 2e-16))))

  (+ (* (+ 1.0 (* t 2e-16)) (+ 1.0 (* t 2e-16))) (- -1.0 (* 2.0 (* t 2e-16)))))