Average Error: 61.8 → 0.3
Time: 5.9s
Precision: 64
Internal Precision: 128
\[\left(1 + t \cdot 2 \cdot 10^{-16}\right) \cdot \left(1 + t \cdot 2 \cdot 10^{-16}\right) + \left(-1 - 2 \cdot \left(t \cdot 2 \cdot 10^{-16}\right)\right)\]
\[{t}^{2} \cdot 3.9999999999999997 \cdot 10^{-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
\[(\left(1 + t \cdot 2 \cdot 10^{-16}\right) \cdot \left(1 + t \cdot 2 \cdot 10^{-16}\right) + \left(-1 - 2 \cdot \left(t \cdot 2 \cdot 10^{-16}\right)\right))_*\]

Derivation

  1. Initial program 61.8

    \[\left(1 + t \cdot 2 \cdot 10^{-16}\right) \cdot \left(1 + t \cdot 2 \cdot 10^{-16}\right) + \left(-1 - 2 \cdot \left(t \cdot 2 \cdot 10^{-16}\right)\right)\]
  2. Simplified0.4

    \[\leadsto \color{blue}{\left(2 \cdot 10^{-16} \cdot t\right) \cdot \left(2 \cdot 10^{-16} \cdot t\right)}\]
  3. Using strategy rm
  4. Applied associate-*l*0.3

    \[\leadsto \color{blue}{2 \cdot 10^{-16} \cdot \left(t \cdot \left(2 \cdot 10^{-16} \cdot t\right)\right)}\]
  5. Taylor expanded around inf 0.3

    \[\leadsto \color{blue}{3.9999999999999997 \cdot 10^{-32} \cdot {t}^{2}}\]
  6. Final simplification0.3

    \[\leadsto {t}^{2} \cdot 3.9999999999999997 \cdot 10^{-32}\]

Reproduce

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

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

  (+ (* (+ 1 (* t 2e-16)) (+ 1 (* t 2e-16))) (- -1 (* 2 (* t 2e-16)))))

Details

Time bar (total: 4.9s)Debug log

sample88.0ms

Algorithm
intervals

simplify1.1s

Counts
1 → 1
Calls

1 calls. Slowest were:

1.1s
(+ (* (+ 1 (* t 2e-16)) (+ 1 (* t 2e-16))) (- -1 (* 2 (* t 2e-16))))

prune13.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.4b

localize11.0ms

Local error

Found 1 expressions with local error:

0.4b
(* (* 2e-16 t) (* 2e-16 t))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
1 → 16
Calls

1 calls. Slowest were:

7.0ms
(* (* 2e-16 t) (* 2e-16 t))

series15.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

15.0ms
(* (* 2e-16 t) (* 2e-16 t))

simplify761.0ms

Counts
9 → 19
Calls

9 calls. Slowest were:

727.0ms
(* (* (* (* 2e-16 t) (* 2e-16 t)) (* 2e-16 t)) (* (* (* 2e-16 t) (* 2e-16 t)) (* 2e-16 t)))
11.0ms
(+ (log (* 2e-16 t)) (log (* 2e-16 t)))
8.0ms
(* (* 2e-16 t) (* 2e-16 t))

prune113.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.0b

localize5.0ms

Local error

Found 2 expressions with local error:

0.3b
(* 2e-16 (* t (* 2e-16 t)))
0.2b
(* t (* 2e-16 t))

rewrite3.0ms

Algorithm
rewrite-expression-head
Counts
2 → 18
Calls

2 calls. Slowest were:

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

series25.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

14.0ms
(* 2e-16 (* t (* 2e-16 t)))
11.0ms
(* t (* 2e-16 t))

simplify34.0ms

Counts
7 → 24
Calls

7 calls. Slowest were:

7.0ms
(* 2e-16 (pow t 2))
7.0ms
(* 2e-16 (pow t 2))
7.0ms
(* 2e-16 (pow t 2))

prune181.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.0b

localize12.0ms

Local error

Found 1 expressions with local error:

0.3b
(* 3.9999999999999997e-32 (pow t 2))

rewrite3.0ms

Algorithm
rewrite-expression-head
Counts
1 → 12
Calls

1 calls. Slowest were:

2.0ms
(* 3.9999999999999997e-32 (pow t 2))

series18.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

18.0ms
(* 3.9999999999999997e-32 (pow t 2))

simplify15.0ms

Counts
6 → 15
Calls

6 calls. Slowest were:

4.0ms
(* 3.9999999999999997e-32 (pow t 2))
3.0ms
(* 3.9999999999999997e-32 (pow t 2))
3.0ms
(* 3.9999999999999997e-32 (pow t 2))

prune102.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 1 expressions with local error:

0.2b
(* (* 3.9999999999999997e-32 (sqrt (pow t 2))) (fabs t))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
1 → 15
Calls

1 calls. Slowest were:

6.0ms
(* (* 3.9999999999999997e-32 (sqrt (pow t 2))) (fabs t))

series20.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

20.0ms
(* (* 3.9999999999999997e-32 (sqrt (pow t 2))) (fabs t))

simplify324.0ms

Counts
9 → 18
Calls

9 calls. Slowest were:

270.0ms
(* (* (* (* 3.9999999999999997e-32 (sqrt (pow t 2))) (* 3.9999999999999997e-32 (sqrt (pow t 2)))) (* 3.9999999999999997e-32 (sqrt (pow t 2)))) (* (* (fabs t) (fabs t)) (fabs t)))
17.0ms
(* (* 3.9999999999999997e-32 (sqrt (pow t 2))) (fabs t))
10.0ms
(+ (log (* 3.9999999999999997e-32 (sqrt (pow t 2)))) (log (fabs t)))

prune108.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0.0b

regimes28.0ms

Accuracy

0% (0.3b remaining)

Error of 0.3b against oracle of 0.0b and baseline of 0.3b

bsearch1.0ms

end0.0ms

sample1.9s

Algorithm
intervals