Average Error: 0.0 → 0.0
Time: 14.9s
Precision: 64
Internal Precision: 128
\[\left(\left(d1 \cdot d2 - d1 \cdot d3\right) + d4 \cdot d1\right) - d1 \cdot d1\]
\[\left(\left(d1 \cdot d2 - d3 \cdot d1\right) + d1 \cdot d4\right) - d1 \cdot d1\]

Error

Bits error versus d1

Bits error versus d2

Bits error versus d3

Bits error versus d4

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[d1 \cdot \left(\left(\left(d2 - d3\right) + d4\right) - d1\right)\]

Derivation

  1. Initial program 0.0

    \[\left(\left(d1 \cdot d2 - d1 \cdot d3\right) + d4 \cdot d1\right) - d1 \cdot d1\]
  2. Final simplification0.0

    \[\leadsto \left(\left(d1 \cdot d2 - d3 \cdot d1\right) + d1 \cdot d4\right) - d1 \cdot d1\]

Reproduce

herbie shell --seed 2019022 +o rules:numerics
(FPCore (d1 d2 d3 d4)
  :name "FastMath dist4"

  :herbie-target
  (* d1 (- (+ (- d2 d3) d4) d1))

  (- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1)))

Details

Time bar (total: 14.5s)Debug log

sample78.0ms

Algorithm
intervals
Results
60.0ms377×body80valid

simplify179.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
178.0ms
(- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1))

prune16.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.0b

localize28.0ms

Local error

Found 3 expressions with local error:

0.0b
(- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1))
0.0b
(- (* d1 d2) (* d1 d3))
0.0b
(+ (- (* d1 d2) (* d1 d3)) (* d4 d1))

rewrite94.0ms

Algorithm
rewrite-expression-head
Rules
19×add-log-exp
add-sqr-sqrt
add-cube-cbrt
diff-log
*-un-lft-identity
prod-diff
fma-neg
fma-def
sum-log
log1p-expm1-u
add-exp-log
add-cbrt-cube
sub-neg
associate-+l+
pow1
expm1-log1p-u
distribute-lft-out--
flip--
associate-+l-
flip3--
difference-of-squares
flip-+
associate--l+
flip3-+
+-commutative
associate--l-
Counts
3 → 64
Calls
3 calls:
Slowest
76.0ms
(- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1))
14.0ms
(+ (- (* d1 d2) (* d1 d3)) (* d4 d1))
3.0ms
(- (* d1 d2) (* d1 d3))

series111.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
46.0ms
(- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1))
34.0ms
(+ (- (* d1 d2) (* d1 d3)) (* d4 d1))
31.0ms
(- (* d1 d2) (* d1 d3))

simplify3.2s

Counts
36 → 73
Calls
36 calls:
Slowest
500.0ms
(fma (sqrt (+ (- (* d1 d2) (* d1 d3)) (* d4 d1))) (sqrt (+ (- (* d1 d2) (* d1 d3)) (* d4 d1))) (- (* d1 d1)))
289.0ms
(/ (* (exp (- (* d1 d2) (* d1 d3))) (exp (* d4 d1))) (exp (* d1 d1)))
261.0ms
(fma (* (cbrt (+ (- (* d1 d2) (* d1 d3)) (* d4 d1))) (cbrt (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)))) (cbrt (+ (- (* d1 d2) (* d1 d3)) (* d4 d1))) (- (* d1 d1)))
258.0ms
(fma 1 (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (- (* d1 d1)))
195.0ms
(* (exp (- (* d1 d2) (* d1 d3))) (exp (* d4 d1)))

prune616.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0.0b

localize14.0ms

Local error

Found 1 expressions with local error:

0.0b
(* d1 (- (+ d2 d4) (+ d3 d1)))

rewrite12.0ms

Algorithm
rewrite-expression-head
Rules
18×prod-diff
16×*-un-lft-identity
16×add-sqr-sqrt
14×add-cube-cbrt
12×distribute-lft-in
12×distribute-rgt-in
associate-*r/
associate-*r*
flip-+
frac-sub
flip3-+
associate--l+
sub-neg
difference-of-squares
add-log-exp
distribute-lft-out--
flip--
log1p-expm1-u
*-commutative
add-exp-log
add-cbrt-cube
flip3--
pow1
expm1-log1p-u
Counts
1 → 45
Calls
1 calls:
Slowest
11.0ms
(* d1 (- (+ d2 d4) (+ d3 d1)))

series36.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
36.0ms
(* d1 (- (+ d2 d4) (+ d3 d1)))

simplify5.4s

Counts
38 → 48
Calls
38 calls:
Slowest
514.0ms
(* (fma (- (+ d3 d1)) 1 (* (+ d3 d1) 1)) d1)
449.0ms
(* (+ (* d2 d2) (- (* d4 d4) (* d2 d4))) (+ (* d3 d3) (- (* d1 d1) (* d3 d1))))
269.0ms
(* d1 (fma (- (+ d3 d1)) 1 (* (+ d3 d1) 1)))
259.0ms
(* (fma (- (+ d3 d1)) 1 (* (+ d3 d1) 1)) d1)
244.0ms
(* d1 (fma (- (+ d3 d1)) 1 (* (+ d3 d1) 1)))

prune461.0ms

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize24.0ms

Local error

Found 4 expressions with local error:

0.6b
(cbrt (+ d3 d1))
0.6b
(cbrt (+ d3 d1))
0.6b
(cbrt (+ d3 d1))
0.5b
(* (cbrt (+ d3 d1)) (cbrt (+ d3 d1)))

rewrite9.0ms

Algorithm
rewrite-expression-head
Rules
18×cbrt-div
15×cbrt-prod
11×add-cube-cbrt
11×*-un-lft-identity
11×add-sqr-sqrt
flip-+
flip3-+
pow1
pow1/3
add-exp-log
associate-*l*
associate-*r*
add-log-exp
log1p-expm1-u
add-cbrt-cube
frac-times
expm1-log1p-u
pow-prod-up
associate-*r/
associate-*l/
pow-prod-down
cbrt-unprod
*-commutative
prod-exp
pow-plus
pow2
Counts
4 → 83
Calls
4 calls:
Slowest
6.0ms
(* (cbrt (+ d3 d1)) (cbrt (+ d3 d1)))
1.0ms
(cbrt (+ d3 d1))
1.0ms
(cbrt (+ d3 d1))
1.0ms
(cbrt (+ d3 d1))

series464.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
136.0ms
(* (cbrt (+ d3 d1)) (cbrt (+ d3 d1)))
111.0ms
(cbrt (+ d3 d1))
109.0ms
(cbrt (+ d3 d1))
108.0ms
(cbrt (+ d3 d1))

simplify1.4s

Counts
59 → 95
Calls
59 calls:
Slowest
159.0ms
(- (+ (pow d1 1/3) (* 1/3 (* d3 (pow (/ 1 (pow d1 2)) 1/3)))) (* 1/9 (* (pow d3 2) (pow (/ 1 (pow d1 5)) 1/3))))
158.0ms
(- (+ (pow d1 1/3) (* 1/3 (* d3 (pow (/ 1 (pow d1 2)) 1/3)))) (* 1/9 (* (pow d3 2) (pow (/ 1 (pow d1 5)) 1/3))))
157.0ms
(- (+ (pow d1 1/3) (* 1/3 (* d3 (pow (/ 1 (pow d1 2)) 1/3)))) (* 1/9 (* (pow d3 2) (pow (/ 1 (pow d1 5)) 1/3))))
147.0ms
(- (+ (* 2/3 (* d3 (pow (/ 1 d1) 1/3))) (pow d1 2/3)) (* 1/9 (* (pow d3 2) (pow (/ 1 (pow d1 4)) 1/3))))
74.0ms
(* (cbrt (- (* d3 d3) (* d1 d1))) (cbrt (+ (pow d3 3) (pow d1 3))))

prune927.0ms

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes168.0ms

Accuracy

0% (0.0b remaining)

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

bsearch1.0ms

end0.0ms

sample1.3s

Algorithm
intervals
Results
1.1s11932×body80valid