Average Error: 61.8 → 0.3
Time: 5.3s
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.4

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

    \[\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 2019010 +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.8s)Debug log

sample64.0ms

Algorithm
intervals

simplify404.0ms

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

prune9.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 57.6b

localize15.0ms

Local error

Found 2 expressions with local error:

53.0b
(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
Rules
add-log-exp
log1p-expm1-u
fma-udef
add-cube-cbrt
add-exp-log
add-cbrt-cube
*-un-lft-identity
pow1
expm1-log1p-u
add-sqr-sqrt
Counts
2 → 20
Calls
2 calls:
Slowest
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)

series111.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
68.0ms
(fma -2 (* 2e-16 t) (fma (fma t 2e-16 1) (fma t 2e-16 1) -1))
43.0ms
(fma (fma t 2e-16 1) (fma t 2e-16 1) -1)

simplify77.0ms

Counts
6 → 26
Calls
6 calls:
Slowest
31.0ms
(+ (* 4e-16 t) (* 3.9999999999999997e-32 (pow t 2)))
17.0ms
(+ (* 4e-16 t) (* 3.9999999999999997e-32 (pow t 2)))
17.0ms
(+ (* 4e-16 t) (* 3.9999999999999997e-32 (pow t 2)))
4.0ms
(* 3.9999999999999997e-32 (pow t 2))
4.0ms
(* 3.9999999999999997e-32 (pow t 2))

prune230.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.3b

localize6.0ms

Local error

Found 1 expressions with local error:

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

rewrite1.0ms

Algorithm
rewrite-expression-head
Rules
associate-*r*
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
unpow2
log1p-expm1-u
*-commutative
add-exp-log
add-cbrt-cube
pow1
expm1-log1p-u
Counts
1 → 14
Calls
1 calls:
Slowest
1.0ms
(* 3.9999999999999997e-32 (pow t 2))

series18.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
18.0ms
(* 3.9999999999999997e-32 (pow t 2))

simplify33.0ms

Counts
6 → 17
Calls
6 calls:
Slowest
10.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
(cbrt (pow t 2))
3.0ms
(sqrt (pow t 2))

prune108.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0.1b

localize9.0ms

Local error

Found 1 expressions with local error:

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

rewrite4.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
log1p-expm1-u
add-cube-cbrt
*-commutative
add-exp-log
associate-*l*
add-cbrt-cube
*-un-lft-identity
pow1
expm1-log1p-u
add-sqr-sqrt
Counts
1 → 11
Calls
1 calls:
Slowest
4.0ms
(* (* 3.9999999999999997e-32 t) t)

series18.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
18.0ms
(* (* 3.9999999999999997e-32 t) t)

simplify18.0ms

Counts
3 → 14
Calls
3 calls:
Slowest
7.0ms
(* 3.9999999999999997e-32 (pow t 2))
6.0ms
(* 3.9999999999999997e-32 (pow t 2))
4.0ms
(* 3.9999999999999997e-32 (pow t 2))

prune100.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.1b
(sqrt (* (* 3.9999999999999997e-32 t) t))

rewrite14.0ms

Algorithm
rewrite-expression-head
Rules
pow1
add-cube-cbrt
add-exp-log
associate-*l*
add-cbrt-cube
*-un-lft-identity
add-sqr-sqrt
pow1/2
add-log-exp
log1p-expm1-u
associate-*r*
expm1-log1p-u
sqrt-prod
*-commutative
pow-prod-up
pow-prod-down
cbrt-unprod
prod-exp
sqrt-unprod
pow-plus
rem-square-sqrt
pow2
Counts
4 → 61
Calls
4 calls:
Slowest
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)
1.0ms
(sqrt (* (* 3.9999999999999997e-32 t) t))

series120.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
73.0ms
(* (sqrt (* (* 3.9999999999999997e-32 t) t)) (sqrt (* (* 3.9999999999999997e-32 t) t)))
20.0ms
(sqrt (* (* 3.9999999999999997e-32 t) t))
14.0ms
(* (* 3.9999999999999997e-32 t) t)
12.0ms
(* (* 3.9999999999999997e-32 t) t)

simplify606.0ms

Counts
31 → 73
Calls
31 calls:
Slowest
371.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))))
37.0ms
(* (* (* 3.9999999999999997e-32 t) t) (* (* 3.9999999999999997e-32 t) t))
35.0ms
(* (* (* 3.9999999999999997e-32 t) t) (* (* 3.9999999999999997e-32 t) t))
19.0ms
(* -1 (* t (sqrt 3.9999999999999997e-32)))
15.0ms
(* (pow t 2) (pow (sqrt 3.9999999999999997e-32) 2))

prune541.0ms

Pruning

8 alts after pruning (7 fresh and 1 done)

Merged error: 0.0b

regimes49.0ms

Accuracy

0% (0.3b remaining)

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

bsearch1.0ms

end0.0ms

sample2.2s

Algorithm
intervals