Average Error: 61.8 → 0.3
Time: 5.2s
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)\]
\[\left(3.9999999999999997 \cdot 10^{-32} \cdot t\right) \cdot t\]

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. Simplified57.6

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

    \[\leadsto \color{blue}{3.9999999999999997 \cdot 10^{-32} \cdot {t}^{2}}\]
  4. Using strategy rm
  5. Applied unpow20.3

    \[\leadsto 3.9999999999999997 \cdot 10^{-32} \cdot \color{blue}{\left(t \cdot t\right)}\]
  6. Applied associate-*r*0.3

    \[\leadsto \color{blue}{\left(3.9999999999999997 \cdot 10^{-32} \cdot t\right) \cdot t}\]
  7. Final simplification0.3

    \[\leadsto \left(3.9999999999999997 \cdot 10^{-32} \cdot t\right) \cdot t\]

Reproduce

herbie shell --seed 2019008 +o rules:numerics
(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.5s)Debug log

sample37.0ms

Algorithm
intervals

simplify440.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune19.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 57.6b

localize18.0ms

Local error

Found 2 expressions with local error:

52.7b
(fma -2 (* 2e-16 t) (fma (fma t 2e-16 1) (fma t 2e-16 1) -1))
49.7b
(fma (fma t 2e-16 1) (fma t 2e-16 1) -1)

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
2 → 20
Calls

2 calls. Slowest were:

0.0ms
(fma -2 (* 2e-16 t) (fma (fma t 2e-16 1) (fma t 2e-16 1) -1))
0.0ms
(fma (fma t 2e-16 1) (fma t 2e-16 1) -1)

series110.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

72.0ms
(fma -2 (* 2e-16 t) (fma (fma t 2e-16 1) (fma t 2e-16 1) -1))
38.0ms
(fma (fma t 2e-16 1) (fma t 2e-16 1) -1)

simplify93.0ms

Counts
6 → 26
Calls

6 calls. Slowest were:

31.0ms
(+ (* 4e-16 t) (* 3.9999999999999997e-32 (pow t 2)))
29.0ms
(+ (* 4e-16 t) (* 3.9999999999999997e-32 (pow t 2)))
19.0ms
(+ (* 4e-16 t) (* 3.9999999999999997e-32 (pow t 2)))

prune224.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.3b

localize11.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 → 14
Calls

1 calls. Slowest were:

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

series21.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify27.0ms

Counts
6 → 17
Calls

6 calls. Slowest were:

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

prune111.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.1b

localize10.0ms

Local error

Found 1 expressions with local error:

0.2b
(* (* 3.9999999999999997e-32 t) t)

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
1 → 11
Calls

1 calls. Slowest were:

5.0ms
(* (* 3.9999999999999997e-32 t) t)

series14.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

14.0ms
(* (* 3.9999999999999997e-32 t) t)

simplify13.0ms

Counts
3 → 14
Calls

3 calls. Slowest were:

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

prune84.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0.1b

localize5.0ms

Local error

Found 4 expressions with local error:

0.4b
(* (sqrt (* (* 3.9999999999999997e-32 t) t)) (sqrt (* (* 3.9999999999999997e-32 t) t)))
0.2b
(* (* 3.9999999999999997e-32 t) t)
0.2b
(* (* 3.9999999999999997e-32 t) t)
0.2b
(sqrt (* (* 3.9999999999999997e-32 t) t))

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
4 → 61
Calls

4 calls. Slowest were:

8.0ms
(* (sqrt (* (* 3.9999999999999997e-32 t) t)) (sqrt (* (* 3.9999999999999997e-32 t) t)))
2.0ms
(* (* 3.9999999999999997e-32 t) t)
2.0ms
(* (* 3.9999999999999997e-32 t) t)

series143.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

70.0ms
(* (sqrt (* (* 3.9999999999999997e-32 t) t)) (sqrt (* (* 3.9999999999999997e-32 t) t)))
35.0ms
(sqrt (* (* 3.9999999999999997e-32 t) t))
20.0ms
(* (* 3.9999999999999997e-32 t) t)
18.0ms
(* (* 3.9999999999999997e-32 t) t)

simplify671.0ms

Counts
31 → 73
Calls

31 calls. Slowest were:

400.0ms
(* (* (* (sqrt (* (* 3.9999999999999997e-32 t) t)) (sqrt (* (* 3.9999999999999997e-32 t) t))) (sqrt (* (* 3.9999999999999997e-32 t) t))) (* (* (sqrt (* (* 3.9999999999999997e-32 t) t)) (sqrt (* (* 3.9999999999999997e-32 t) t))) (sqrt (* (* 3.9999999999999997e-32 t) t))))
76.0ms
(* (* (* 3.9999999999999997e-32 t) t) (* (* 3.9999999999999997e-32 t) t))
48.0ms
(* (* (* 3.9999999999999997e-32 t) t) (* (* 3.9999999999999997e-32 t) t))

prune477.0ms

Pruning

8 alts after pruning (6 fresh and 2 done)

Merged error: 0.0b

regimes29.0ms

Accuracy

0% (0.3b remaining)

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

bsearch1.0ms

end0.0ms

sample2.0s

Algorithm
intervals