Average Error: 61.8 → 0.3
Time: 6.0s
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(2 \cdot 10^{-16} \cdot \left(2 \cdot 10^{-16} \cdot t\right)\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. 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-*r*0.3

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

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

Reproduce

herbie shell --seed 2019010 
(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: 5.4s)Debug log

sample78.0ms

Algorithm
intervals

simplify1.3s

Counts
1 → 1
Calls
1 calls:
Slowest
1.3s
(+ (* (+ 1 (* t 2e-16)) (+ 1 (* t 2e-16))) (- -1 (* 2 (* t 2e-16))))

prune6.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.4b

localize6.0ms

Local error

Found 1 expressions with local error:

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

rewrite4.0ms

Algorithm
rewrite-expression-head
Rules
pow1
add-exp-log
add-cbrt-cube
add-log-exp
cbrt-unprod
add-cube-cbrt
pow-prod-up
*-commutative
prod-exp
pow-prod-down
associate-*l*
associate-*r*
pow-plus
*-un-lft-identity
add-sqr-sqrt
pow2
Counts
1 → 16
Calls
1 calls:
Slowest
3.0ms
(* (* 2e-16 t) (* 2e-16 t))

series24.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
24.0ms
(* (* 2e-16 t) (* 2e-16 t))

simplify719.0ms

Counts
9 → 19
Calls
9 calls:
Slowest
681.0ms
(* (* (* (* 2e-16 t) (* 2e-16 t)) (* 2e-16 t)) (* (* (* 2e-16 t) (* 2e-16 t)) (* 2e-16 t)))
12.0ms
(+ (log (* 2e-16 t)) (log (* 2e-16 t)))
8.0ms
(* (* 2e-16 t) (* 2e-16 t))
7.0ms
(* 3.9999999999999997e-32 (pow t 2))
3.0ms
(* 3.9999999999999997e-32 (pow t 2))

prune88.0ms

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.0b

localize5.0ms

Local error

Found 2 expressions with local error:

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

rewrite3.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
add-cube-cbrt
*-commutative
add-exp-log
associate-*r*
add-cbrt-cube
*-un-lft-identity
pow1
add-sqr-sqrt
Counts
2 → 18
Calls
2 calls:
Slowest
2.0ms
(* 2e-16 (* t (* 2e-16 t)))
1.0ms
(* t (* 2e-16 t))

series27.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
16.0ms
(* 2e-16 (* t (* 2e-16 t)))
11.0ms
(* t (* 2e-16 t))

simplify40.0ms

Counts
7 → 24
Calls
7 calls:
Slowest
8.0ms
(* 3.9999999999999997e-32 (pow t 2))
7.0ms
(* 2e-16 (pow t 2))
7.0ms
(* 2e-16 (pow t 2))
7.0ms
(* 2e-16 (pow t 2))
3.0ms
(* 3.9999999999999997e-32 (pow t 2))

prune170.0ms

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.0b

localize13.0ms

Local error

Found 2 expressions with local error:

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

rewrite16.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
add-cube-cbrt
*-commutative
add-exp-log
associate-*l*
add-cbrt-cube
*-un-lft-identity
pow1
add-sqr-sqrt
Counts
2 → 18
Calls
2 calls:
Slowest
11.0ms
(* (* (* 2e-16 t) 2e-16) t)
4.0ms
(* (* 2e-16 t) 2e-16)

series34.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
21.0ms
(* (* (* 2e-16 t) 2e-16) t)
13.0ms
(* (* 2e-16 t) 2e-16)

simplify32.0ms

Counts
7 → 24
Calls
7 calls:
Slowest
7.0ms
(* 3.9999999999999997e-32 (pow t 2))
7.0ms
(* 3.9999999999999997e-32 (pow t 2))
7.0ms
(* 3.9999999999999997e-32 (pow t 2))
3.0ms
(* 3.9999999999999997e-32 t)
2.0ms
(* 2e-16 t)

prune147.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0.0b

localize17.0ms

Local error

Found 2 expressions with local error:

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

rewrite7.0ms

Algorithm
rewrite-expression-head
Rules
associate-*r*
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
*-commutative
add-exp-log
add-cbrt-cube
pow1
unpow2
Counts
2 → 21
Calls
2 calls:
Slowest
4.0ms
(* 2e-16 (* 2e-16 (pow t 2)))
2.0ms
(* 2e-16 (pow t 2))

series37.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
20.0ms
(* 2e-16 (* 2e-16 (pow t 2)))
17.0ms
(* 2e-16 (pow t 2))

simplify46.0ms

Counts
10 → 27
Calls
10 calls:
Slowest
10.0ms
(* 2e-16 (pow t 2))
7.0ms
(* 2e-16 (pow t 2))
7.0ms
(* 2e-16 (pow t 2))
6.0ms
(* 3.9999999999999997e-32 (pow t 2))
3.0ms
(* 3.9999999999999997e-32 (pow t 2))

prune147.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0.0b

regimes44.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.4s

Algorithm
intervals