Average Error: 61.8 → 0.4
Time: 7.7s
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({t}^{2} \cdot 2 \cdot 10^{-16}\right) \cdot 2 \cdot 10^{-16}\]

Error

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original61.8
Target50.5
Herbie0.4
\[(\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. Initial simplification0.4

    \[\leadsto \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.4

    \[\leadsto 2 \cdot 10^{-16} \cdot \color{blue}{\left(2 \cdot 10^{-16} \cdot {t}^{2}\right)}\]
  6. Final simplification0.4

    \[\leadsto \left({t}^{2} \cdot 2 \cdot 10^{-16}\right) \cdot 2 \cdot 10^{-16}\]

Reproduce

herbie shell --seed 2018360 +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: 3.9s)Debug log

start95.0ms

Algorithm
intervals

setup2.1s

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.5b

localize6.0ms

Local error

Found 1 expressions with local error:

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

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
1 → 18
Calls

1 calls. Slowest were:

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

series12.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify731.0ms

Counts
9 → 21
Calls

9 calls. Slowest were:

664.0ms
(* (* (* (* 2e-16 t) (* 2e-16 t)) (* 2e-16 t)) (* (* (* 2e-16 t) (* 2e-16 t)) (* 2e-16 t)))
27.0ms
(+ (log (* 2e-16 t)) (log (* 2e-16 t)))
9.0ms
(* (* 2e-16 t) (* 2e-16 t))

prune175.0ms

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.1b

localize11.0ms

Local error

Found 2 expressions with local error:

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

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
2 → 22
Calls

2 calls. Slowest were:

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

series19.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify25.0ms

Counts
7 → 28
Calls

7 calls. Slowest were:

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

prune206.0ms

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0.0b

localize5.0ms

Local error

Found 1 expressions with local error:

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

rewrite3.0ms

Algorithm
rewrite-expression-head
Counts
1 → 11
Calls

1 calls. Slowest were:

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

series13.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify22.0ms

Counts
3 → 14
Calls

3 calls. Slowest were:

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

prune103.0ms

Pruning

7 alts after pruning (5 fresh and 2 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))

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
2 → 22
Calls

2 calls. Slowest were:

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

series23.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify25.0ms

Counts
7 → 28
Calls

7 calls. Slowest were:

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

prune207.0ms

Pruning

8 alts after pruning (5 fresh and 3 done)

Merged error: 0.0b

regimes58.0ms

Accuracy

0% (0.3b remaining)

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

bsearch1.0ms