bug366, discussion (missed optimization)

Time bar (total: 893.0ms)

start0.0ms (0%)

Memory
0.0MiB live, 0.0MiB allocated

analyze32.0ms (3.6%)

Memory
-2.8MiB live, 43.6MiB allocated
Algorithm
search
Search
ProbabilityValidUnknownPreconditionInfiniteDomainCan'tIter
0%0%99.9%0.1%0%0%0%0
0%0%99.9%0.1%0%0%0%1
0%0%99.9%0.1%0%0%0%2
0%0%99.9%0.1%0%0%0%3
0%0%99.9%0.1%0%0%0%4
30.8%25%56.2%0.1%0%18.7%0%5
32%25%53.1%0.1%0%21.9%0%6
55.8%37.5%29.7%0.1%0%32.8%0%7
57.8%37.5%27.3%0.1%0%35.1%0%8
74.2%43.7%15.2%0.1%0%41%0%9
75.9%43.7%13.9%0.1%0%42.3%0%10
85.9%46.8%7.7%0.1%0%45.4%0%11
87%46.8%7%0.1%0%46.1%0%12
Compiler

Compiled 10 to 8 computations (20% saved)

sample670.0ms (75%)

Memory
10.0MiB live, 822.9MiB allocated
Samples
399.0ms8 256×0valid
31.0ms641×0invalid
Precisions
Click to see histograms. Total time spent on operations: 243.0ms
ival-mult: 128.0ms (52.6% of total)
ival-sqrt: 65.0ms (26.7% of total)
ival-sub: 40.0ms (16.4% of total)
ival-true: 7.0ms (2.9% of total)
ival-assert: 4.0ms (1.6% of total)
Bogosity

explain74.0ms (8.3%)

Memory
17.3MiB live, 94.3MiB allocated
FPErrors
Click to see full error table
Ground TruthOverpredictionsExampleUnderpredictionsExampleSubexpression
1340-0-(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
160-0-(-.f64 (*.f64 a a) (*.f64 b b))
00-0-(*.f64 a a)
00-0-a
00-0-b
00-0-(*.f64 b b)
Explanations
Click to see full explanations table
OperatorSubexpressionExplanationCount
sqrt.f64(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))oflow-rescue1170
(*.f64 b b)overflow16
(-.f64 (*.f64 a a) (*.f64 b b))overflow117
(*.f64 a a)overflow117
sqrt.f64(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))uflow-rescue170
(*.f64 b b)underflow111
(-.f64 (*.f64 a a) (*.f64 b b))underflow17
(*.f64 a a)underflow17
-.f64(-.f64 (*.f64 a a) (*.f64 b b))nan-rescue160
(*.f64 a a)overflow117
(*.f64 b b)overflow16
Confusion
Predicted +Predicted -
+1340
-0122
Precision
1.0
Recall
1.0
Confusion?
Predicted +Predicted MaybePredicted -
+13400
-00122
Precision?
1.0
Recall?
1.0
Freqs
test
numberfreq
0122
1118
216
Total Confusion?
Predicted +Predicted MaybePredicted -
+100
-000
Precision?
1.0
Recall?
1.0
Samples
29.0ms512×0valid
Compiler

Compiled 81 to 28 computations (65.4% saved)

Precisions
Click to see histograms. Total time spent on operations: 17.0ms
ival-mult: 10.0ms (60.2% of total)
ival-sqrt: 4.0ms (24.1% of total)
ival-sub: 2.0ms (12% of total)
ival-true: 0.0ms (0% of total)
ival-assert: 0.0ms (0% of total)

preprocess3.0ms (0.3%)

Memory
4.7MiB live, 4.7MiB allocated
Algorithm
egg-herbie
Calls
Call 1
Inputs
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
Outputs
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
Compiler

Compiled 8 to 6 computations (25% saved)

eval0.0ms (0%)

Memory
0.1MiB live, 0.1MiB allocated
Compiler

Compiled 0 to 2 computations (-∞% saved)

prune5.0ms (0.6%)

Memory
-41.1MiB live, 0.7MiB allocated
Alt Table
Click to see full alt table
StatusAccuracyProgram
50.9%
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
Compiler

Compiled 8 to 6 computations (25% saved)

simplify0.0ms (0%)

Memory
0.5MiB live, 0.5MiB allocated
Algorithm
egg-herbie
Localize:

Found 4 expressions of interest:

NewMetricScoreProgram
cost-diff0
(*.f64 b b)
cost-diff0
(*.f64 a a)
cost-diff0
(-.f64 (*.f64 a a) (*.f64 b b))
cost-diff0
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
Calls
Call 1
Inputs
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
(-.f64 (*.f64 a a) (*.f64 b b))
(*.f64 a a)
a
(*.f64 b b)
b
Outputs
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
(-.f64 (*.f64 a a) (*.f64 b b))
(*.f64 a a)
a
(*.f64 b b)
b

localize18.0ms (2%)

Memory
25.3MiB live, 25.3MiB allocated
Localize:

Found 4 expressions of interest:

NewMetricScoreProgram
accuracy0.0
(*.f64 b b)
accuracy0.0
(*.f64 a a)
accuracy3.19140625
(-.f64 (*.f64 a a) (*.f64 b b))
accuracy31.106929925090846
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
Samples
13.0ms256×0valid
Compiler

Compiled 48 to 14 computations (70.8% saved)

Precisions
Click to see histograms. Total time spent on operations: 7.0ms
ival-mult: 4.0ms (59.5% of total)
ival-sqrt: 2.0ms (29.8% of total)
ival-sub: 1.0ms (14.9% of total)
ival-true: 0.0ms (0% of total)
ival-assert: 0.0ms (0% of total)

series5.0ms (0.6%)

Memory
7.7MiB live, 7.7MiB allocated
Counts
4 → 29
Calls
Call 1
Inputs
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
(-.f64 (*.f64 a a) (*.f64 b b))
(*.f64 a a)
(*.f64 b b)
Outputs
(* b (sqrt -1))
(+ (* 1/2 (/ (pow a 2) (* b (sqrt -1)))) (* b (sqrt -1)))
(+ (* b (sqrt -1)) (* (pow a 2) (+ (* -1/8 (/ (pow a 2) (* (pow b 3) (pow (sqrt -1) 3)))) (* 1/2 (/ 1 (* b (sqrt -1)))))))
(+ (* b (sqrt -1)) (* (pow a 2) (+ (* (pow a 2) (- (* 1/16 (/ (pow a 2) (* (pow b 5) (pow (sqrt -1) 5)))) (* 1/8 (/ 1 (* (pow b 3) (pow (sqrt -1) 3)))))) (* 1/2 (/ 1 (* b (sqrt -1)))))))
(* -1 (pow b 2))
(- (pow a 2) (pow b 2))
(pow a 2)
a
(* a (+ 1 (* -1/2 (/ (pow b 2) (pow a 2)))))
(* a (+ 1 (+ (* -1/2 (/ (pow b 2) (pow a 2))) (* -1/8 (/ (pow b 4) (pow a 4))))))
(* a (+ 1 (+ (* -1/2 (/ (pow b 2) (pow a 2))) (+ (* -1/8 (/ (pow b 4) (pow a 4))) (* -1/16 (/ (pow b 6) (pow a 6)))))))
(* (pow a 2) (+ 1 (* -1 (/ (pow b 2) (pow a 2)))))
(* -1 a)
(* -1 (* a (+ 1 (* -1/2 (/ (pow b 2) (pow a 2))))))
(* -1 (* a (+ 1 (+ (* -1/2 (/ (pow b 2) (pow a 2))) (* -1/8 (/ (pow b 4) (pow a 4)))))))
(* -1 (* a (+ 1 (+ (* -1/2 (/ (pow b 2) (pow a 2))) (+ (* -1/8 (/ (pow b 4) (pow a 4))) (* -1/16 (/ (pow b 6) (pow a 6))))))))
(+ a (* -1/2 (/ (pow b 2) a)))
(+ a (* (pow b 2) (- (* -1/8 (/ (pow b 2) (pow a 3))) (* 1/2 (/ 1 a)))))
(+ a (* (pow b 2) (- (* (pow b 2) (- (* -1/16 (/ (pow b 2) (pow a 5))) (* 1/8 (/ 1 (pow a 3))))) (* 1/2 (/ 1 a)))))
(+ (* -1 (pow b 2)) (pow a 2))
(pow b 2)
(* b (+ (sqrt -1) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1))))))
(* b (+ (sqrt -1) (+ (* -1/8 (/ (pow a 4) (* (pow b 4) (pow (sqrt -1) 3)))) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1)))))))
(* b (+ (sqrt -1) (+ (* -1/8 (/ (pow a 4) (* (pow b 4) (pow (sqrt -1) 3)))) (+ (* 1/16 (/ (pow a 6) (* (pow b 6) (pow (sqrt -1) 5)))) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1))))))))
(* (pow b 2) (- (/ (pow a 2) (pow b 2)) 1))
(* -1 (* b (sqrt -1)))
(* -1 (* b (+ (sqrt -1) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1)))))))
(* -1 (* b (+ (sqrt -1) (+ (* -1/8 (/ (pow a 4) (* (pow b 4) (pow (sqrt -1) 3)))) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1))))))))
(* -1 (* b (+ (sqrt -1) (+ (* -1/8 (/ (pow a 4) (* (pow b 4) (pow (sqrt -1) 3)))) (+ (* 1/16 (/ (pow a 6) (* (pow b 6) (pow (sqrt -1) 5)))) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1)))))))))
Calls

6 calls:

TimeVariablePointExpression
1.0ms
a
@0
((sqrt (- (* a a) (* b b))) (- (* a a) (* b b)) (* a a) (* b b))
1.0ms
b
@inf
((sqrt (- (* a a) (* b b))) (- (* a a) (* b b)) (* a a) (* b b))
1.0ms
a
@inf
((sqrt (- (* a a) (* b b))) (- (* a a) (* b b)) (* a a) (* b b))
1.0ms
a
@-inf
((sqrt (- (* a a) (* b b))) (- (* a a) (* b b)) (* a a) (* b b))
1.0ms
b
@0
((sqrt (- (* a a) (* b b))) (- (* a a) (* b b)) (* a a) (* b b))

simplify1.0ms (0.1%)

Memory
0.9MiB live, 0.9MiB allocated
Algorithm
egg-herbie
Counts
29 → 4
Calls
Call 1
Inputs
(* b (sqrt -1))
(+ (* 1/2 (/ (pow a 2) (* b (sqrt -1)))) (* b (sqrt -1)))
(+ (* b (sqrt -1)) (* (pow a 2) (+ (* -1/8 (/ (pow a 2) (* (pow b 3) (pow (sqrt -1) 3)))) (* 1/2 (/ 1 (* b (sqrt -1)))))))
(+ (* b (sqrt -1)) (* (pow a 2) (+ (* (pow a 2) (- (* 1/16 (/ (pow a 2) (* (pow b 5) (pow (sqrt -1) 5)))) (* 1/8 (/ 1 (* (pow b 3) (pow (sqrt -1) 3)))))) (* 1/2 (/ 1 (* b (sqrt -1)))))))
(* -1 (pow b 2))
(- (pow a 2) (pow b 2))
(pow a 2)
a
(* a (+ 1 (* -1/2 (/ (pow b 2) (pow a 2)))))
(* a (+ 1 (+ (* -1/2 (/ (pow b 2) (pow a 2))) (* -1/8 (/ (pow b 4) (pow a 4))))))
(* a (+ 1 (+ (* -1/2 (/ (pow b 2) (pow a 2))) (+ (* -1/8 (/ (pow b 4) (pow a 4))) (* -1/16 (/ (pow b 6) (pow a 6)))))))
(* (pow a 2) (+ 1 (* -1 (/ (pow b 2) (pow a 2)))))
(* -1 a)
(* -1 (* a (+ 1 (* -1/2 (/ (pow b 2) (pow a 2))))))
(* -1 (* a (+ 1 (+ (* -1/2 (/ (pow b 2) (pow a 2))) (* -1/8 (/ (pow b 4) (pow a 4)))))))
(* -1 (* a (+ 1 (+ (* -1/2 (/ (pow b 2) (pow a 2))) (+ (* -1/8 (/ (pow b 4) (pow a 4))) (* -1/16 (/ (pow b 6) (pow a 6))))))))
(+ a (* -1/2 (/ (pow b 2) a)))
(+ a (* (pow b 2) (- (* -1/8 (/ (pow b 2) (pow a 3))) (* 1/2 (/ 1 a)))))
(+ a (* (pow b 2) (- (* (pow b 2) (- (* -1/16 (/ (pow b 2) (pow a 5))) (* 1/8 (/ 1 (pow a 3))))) (* 1/2 (/ 1 a)))))
(+ (* -1 (pow b 2)) (pow a 2))
(pow b 2)
(* b (+ (sqrt -1) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1))))))
(* b (+ (sqrt -1) (+ (* -1/8 (/ (pow a 4) (* (pow b 4) (pow (sqrt -1) 3)))) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1)))))))
(* b (+ (sqrt -1) (+ (* -1/8 (/ (pow a 4) (* (pow b 4) (pow (sqrt -1) 3)))) (+ (* 1/16 (/ (pow a 6) (* (pow b 6) (pow (sqrt -1) 5)))) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1))))))))
(* (pow b 2) (- (/ (pow a 2) (pow b 2)) 1))
(* -1 (* b (sqrt -1)))
(* -1 (* b (+ (sqrt -1) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1)))))))
(* -1 (* b (+ (sqrt -1) (+ (* -1/8 (/ (pow a 4) (* (pow b 4) (pow (sqrt -1) 3)))) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1))))))))
(* -1 (* b (+ (sqrt -1) (+ (* -1/8 (/ (pow a 4) (* (pow b 4) (pow (sqrt -1) 3)))) (+ (* 1/16 (/ (pow a 6) (* (pow b 6) (pow (sqrt -1) 5)))) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1)))))))))
Outputs
(* b (sqrt -1))
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
(+ (* 1/2 (/ (pow a 2) (* b (sqrt -1)))) (* b (sqrt -1)))
(-.f64 (*.f64 a a) (*.f64 b b))
(+ (* b (sqrt -1)) (* (pow a 2) (+ (* -1/8 (/ (pow a 2) (* (pow b 3) (pow (sqrt -1) 3)))) (* 1/2 (/ 1 (* b (sqrt -1)))))))
(*.f64 a a)
(+ (* b (sqrt -1)) (* (pow a 2) (+ (* (pow a 2) (- (* 1/16 (/ (pow a 2) (* (pow b 5) (pow (sqrt -1) 5)))) (* 1/8 (/ 1 (* (pow b 3) (pow (sqrt -1) 3)))))) (* 1/2 (/ 1 (* b (sqrt -1)))))))
(*.f64 b b)

rewrite0.0ms (0%)

Memory
0.5MiB live, 0.5MiB allocated
Counts
4 → 4
Calls
Call 1
Inputs
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
(-.f64 (*.f64 a a) (*.f64 b b))
(*.f64 a a)
(*.f64 b b)
Outputs
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
(-.f64 (*.f64 a a) (*.f64 b b))
(*.f64 a a)
(*.f64 b b)

eval1.0ms (0.1%)

Memory
1.4MiB live, 1.4MiB allocated
Compiler

Compiled 89 to 14 computations (84.3% saved)

prune1.0ms (0.1%)

Memory
2.2MiB live, 2.2MiB allocated
Pruning

3 alts after pruning (2 fresh and 1 done)

PrunedKeptTotal
New628
Fresh000
Picked011
Done000
Total639
Accuracy
51.5%
Counts
9 → 3
Alt Table
Click to see full alt table
StatusAccuracyProgram
50.9%
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
4.1%
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 b b))
7.1%
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 a a))
Compiler

Compiled 32 to 22 computations (31.3% saved)

simplify0.0ms (0%)

Memory
0.6MiB live, 0.6MiB allocated
Algorithm
egg-herbie
Localize:

Found 4 expressions of interest:

NewMetricScoreProgram
cost-diff0
(*.f64 b b)
cost-diff0
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 b b))
cost-diff0
(*.f64 a a)
cost-diff0
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 a a))
Calls
Call 1
Inputs
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 a a))
(*.f64 a a)
a
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 b b))
(*.f64 b b)
b
Outputs
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 a a))
(*.f64 a a)
a
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 b b))
(*.f64 b b)
b

localize23.0ms (2.6%)

Memory
-12.8MiB live, 24.4MiB allocated
Localize:

Found 4 expressions of interest:

NewMetricScoreProgram
accuracy0.0
(*.f64 b b)
accuracy61.348414733559
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 b b))
accuracy0.0
(*.f64 a a)
accuracy59.42988485536432
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 a a))
Samples
13.0ms256×0valid
Compiler

Compiled 58 to 18 computations (69% saved)

Precisions
Click to see histograms. Total time spent on operations: 7.0ms
ival-mult: 4.0ms (59.6% of total)
ival-sqrt: 2.0ms (29.8% of total)
ival-sub: 1.0ms (14.9% of total)
ival-true: 0.0ms (0% of total)
ival-assert: 0.0ms (0% of total)

series3.0ms (0.3%)

Memory
4.2MiB live, 4.2MiB allocated
Counts
4 → 24
Calls
Call 1
Inputs
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 a a))
(*.f64 a a)
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 b b))
(*.f64 b b)
Outputs
(* b (sqrt -1))
(+ (* 1/2 (/ (pow a 2) (* b (sqrt -1)))) (* b (sqrt -1)))
(+ (* b (sqrt -1)) (* (pow a 2) (+ (* -1/8 (/ (pow a 2) (* (pow b 3) (pow (sqrt -1) 3)))) (* 1/2 (/ 1 (* b (sqrt -1)))))))
(+ (* b (sqrt -1)) (* (pow a 2) (+ (* (pow a 2) (- (* 1/16 (/ (pow a 2) (* (pow b 5) (pow (sqrt -1) 5)))) (* 1/8 (/ 1 (* (pow b 3) (pow (sqrt -1) 3)))))) (* 1/2 (/ 1 (* b (sqrt -1)))))))
(pow a 2)
a
(* a (+ 1 (* -1/2 (/ (pow b 2) (pow a 2)))))
(* a (+ 1 (+ (* -1/2 (/ (pow b 2) (pow a 2))) (* -1/8 (/ (pow b 4) (pow a 4))))))
(* a (+ 1 (+ (* -1/2 (/ (pow b 2) (pow a 2))) (+ (* -1/8 (/ (pow b 4) (pow a 4))) (* -1/16 (/ (pow b 6) (pow a 6)))))))
(* -1 a)
(* -1 (* a (+ 1 (* -1/2 (/ (pow b 2) (pow a 2))))))
(* -1 (* a (+ 1 (+ (* -1/2 (/ (pow b 2) (pow a 2))) (* -1/8 (/ (pow b 4) (pow a 4)))))))
(* -1 (* a (+ 1 (+ (* -1/2 (/ (pow b 2) (pow a 2))) (+ (* -1/8 (/ (pow b 4) (pow a 4))) (* -1/16 (/ (pow b 6) (pow a 6))))))))
(+ a (* -1/2 (/ (pow b 2) a)))
(+ a (* (pow b 2) (- (* -1/8 (/ (pow b 2) (pow a 3))) (* 1/2 (/ 1 a)))))
(+ a (* (pow b 2) (- (* (pow b 2) (- (* -1/16 (/ (pow b 2) (pow a 5))) (* 1/8 (/ 1 (pow a 3))))) (* 1/2 (/ 1 a)))))
(pow b 2)
(* b (+ (sqrt -1) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1))))))
(* b (+ (sqrt -1) (+ (* -1/8 (/ (pow a 4) (* (pow b 4) (pow (sqrt -1) 3)))) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1)))))))
(* b (+ (sqrt -1) (+ (* -1/8 (/ (pow a 4) (* (pow b 4) (pow (sqrt -1) 3)))) (+ (* 1/16 (/ (pow a 6) (* (pow b 6) (pow (sqrt -1) 5)))) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1))))))))
(* -1 (* b (sqrt -1)))
(* -1 (* b (+ (sqrt -1) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1)))))))
(* -1 (* b (+ (sqrt -1) (+ (* -1/8 (/ (pow a 4) (* (pow b 4) (pow (sqrt -1) 3)))) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1))))))))
(* -1 (* b (+ (sqrt -1) (+ (* -1/8 (/ (pow a 4) (* (pow b 4) (pow (sqrt -1) 3)))) (+ (* 1/16 (/ (pow a 6) (* (pow b 6) (pow (sqrt -1) 5)))) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1)))))))))
Calls

6 calls:

TimeVariablePointExpression
0.0ms
a
@inf
((sqrt (- (* a a) (* b b))) (* a a) (sqrt (- (* a a) (* b b))) (* b b))
0.0ms
b
@-inf
((sqrt (- (* a a) (* b b))) (* a a) (sqrt (- (* a a) (* b b))) (* b b))
0.0ms
b
@inf
((sqrt (- (* a a) (* b b))) (* a a) (sqrt (- (* a a) (* b b))) (* b b))
0.0ms
a
@-inf
((sqrt (- (* a a) (* b b))) (* a a) (sqrt (- (* a a) (* b b))) (* b b))
0.0ms
a
@0
((sqrt (- (* a a) (* b b))) (* a a) (sqrt (- (* a a) (* b b))) (* b b))

simplify1.0ms (0.1%)

Memory
0.7MiB live, 0.7MiB allocated
Algorithm
egg-herbie
Counts
24 → 4
Calls
Call 1
Inputs
(* b (sqrt -1))
(+ (* 1/2 (/ (pow a 2) (* b (sqrt -1)))) (* b (sqrt -1)))
(+ (* b (sqrt -1)) (* (pow a 2) (+ (* -1/8 (/ (pow a 2) (* (pow b 3) (pow (sqrt -1) 3)))) (* 1/2 (/ 1 (* b (sqrt -1)))))))
(+ (* b (sqrt -1)) (* (pow a 2) (+ (* (pow a 2) (- (* 1/16 (/ (pow a 2) (* (pow b 5) (pow (sqrt -1) 5)))) (* 1/8 (/ 1 (* (pow b 3) (pow (sqrt -1) 3)))))) (* 1/2 (/ 1 (* b (sqrt -1)))))))
(pow a 2)
a
(* a (+ 1 (* -1/2 (/ (pow b 2) (pow a 2)))))
(* a (+ 1 (+ (* -1/2 (/ (pow b 2) (pow a 2))) (* -1/8 (/ (pow b 4) (pow a 4))))))
(* a (+ 1 (+ (* -1/2 (/ (pow b 2) (pow a 2))) (+ (* -1/8 (/ (pow b 4) (pow a 4))) (* -1/16 (/ (pow b 6) (pow a 6)))))))
(* -1 a)
(* -1 (* a (+ 1 (* -1/2 (/ (pow b 2) (pow a 2))))))
(* -1 (* a (+ 1 (+ (* -1/2 (/ (pow b 2) (pow a 2))) (* -1/8 (/ (pow b 4) (pow a 4)))))))
(* -1 (* a (+ 1 (+ (* -1/2 (/ (pow b 2) (pow a 2))) (+ (* -1/8 (/ (pow b 4) (pow a 4))) (* -1/16 (/ (pow b 6) (pow a 6))))))))
(+ a (* -1/2 (/ (pow b 2) a)))
(+ a (* (pow b 2) (- (* -1/8 (/ (pow b 2) (pow a 3))) (* 1/2 (/ 1 a)))))
(+ a (* (pow b 2) (- (* (pow b 2) (- (* -1/16 (/ (pow b 2) (pow a 5))) (* 1/8 (/ 1 (pow a 3))))) (* 1/2 (/ 1 a)))))
(pow b 2)
(* b (+ (sqrt -1) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1))))))
(* b (+ (sqrt -1) (+ (* -1/8 (/ (pow a 4) (* (pow b 4) (pow (sqrt -1) 3)))) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1)))))))
(* b (+ (sqrt -1) (+ (* -1/8 (/ (pow a 4) (* (pow b 4) (pow (sqrt -1) 3)))) (+ (* 1/16 (/ (pow a 6) (* (pow b 6) (pow (sqrt -1) 5)))) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1))))))))
(* -1 (* b (sqrt -1)))
(* -1 (* b (+ (sqrt -1) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1)))))))
(* -1 (* b (+ (sqrt -1) (+ (* -1/8 (/ (pow a 4) (* (pow b 4) (pow (sqrt -1) 3)))) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1))))))))
(* -1 (* b (+ (sqrt -1) (+ (* -1/8 (/ (pow a 4) (* (pow b 4) (pow (sqrt -1) 3)))) (+ (* 1/16 (/ (pow a 6) (* (pow b 6) (pow (sqrt -1) 5)))) (* 1/2 (/ (pow a 2) (* (pow b 2) (sqrt -1)))))))))
Outputs
(* b (sqrt -1))
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 a a))
(+ (* 1/2 (/ (pow a 2) (* b (sqrt -1)))) (* b (sqrt -1)))
(*.f64 a a)
(+ (* b (sqrt -1)) (* (pow a 2) (+ (* -1/8 (/ (pow a 2) (* (pow b 3) (pow (sqrt -1) 3)))) (* 1/2 (/ 1 (* b (sqrt -1)))))))
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 b b))
(+ (* b (sqrt -1)) (* (pow a 2) (+ (* (pow a 2) (- (* 1/16 (/ (pow a 2) (* (pow b 5) (pow (sqrt -1) 5)))) (* 1/8 (/ 1 (* (pow b 3) (pow (sqrt -1) 3)))))) (* 1/2 (/ 1 (* b (sqrt -1)))))))
(*.f64 b b)

rewrite0.0ms (0%)

Memory
0.5MiB live, 0.5MiB allocated
Counts
4 → 4
Calls
Call 1
Inputs
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 a a))
(*.f64 a a)
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 b b))
(*.f64 b b)
Outputs
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 a a))
(*.f64 a a)
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 b b))
(*.f64 b b)

eval1.0ms (0.1%)

Memory
1.2MiB live, 1.2MiB allocated
Compiler

Compiled 90 to 12 computations (86.7% saved)

prune2.0ms (0.2%)

Memory
3.6MiB live, 3.6MiB allocated
Pruning

3 alts after pruning (0 fresh and 3 done)

PrunedKeptTotal
New606
Fresh000
Picked022
Done011
Total639
Accuracy
51.5%
Counts
9 → 3
Alt Table
Click to see full alt table
StatusAccuracyProgram
50.9%
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
4.1%
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 b b))
7.1%
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 a a))
Compiler

Compiled 64 to 34 computations (46.9% saved)

regimes15.0ms (1.7%)

Memory
-19.7MiB live, 17.9MiB allocated
Counts
3 → 1
Calls
Call 1
Inputs
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 a a))
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 b b))
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
Outputs
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
Calls

6 calls:

7.0ms
(*.f64 a a)
2.0ms
b
2.0ms
a
2.0ms
(-.f64 (*.f64 a a) (*.f64 b b))
2.0ms
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
Results
AccuracySegmentsBranch
50.9%1a
50.9%1b
50.9%1(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
50.9%1(-.f64 (*.f64 a a) (*.f64 b b))
50.9%1(*.f64 a a)
50.9%1(*.f64 b b)
Compiler

Compiled 23 to 21 computations (8.7% saved)

regimes8.0ms (0.9%)

Memory
14.4MiB live, 14.4MiB allocated
Accuracy

Total -2.0b remaining (-3.4%)

Threshold costs -2b (-3.4%)

Counts
2 → 1
Calls
Call 1
Inputs
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 a a))
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 b b))
Outputs
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 a a))
Calls

6 calls:

1.0ms
b
1.0ms
a
1.0ms
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
1.0ms
(-.f64 (*.f64 a a) (*.f64 b b))
1.0ms
(*.f64 a a)
Results
AccuracySegmentsBranch
7.1%1(*.f64 a a)
7.1%1b
7.1%1(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
7.1%1(-.f64 (*.f64 a a) (*.f64 b b))
7.1%1a
7.1%1(*.f64 b b)
Compiler

Compiled 23 to 21 computations (8.7% saved)

simplify5.0ms (0.5%)

Memory
7.5MiB live, 7.5MiB allocated
Algorithm
egg-herbie
Calls
Call 1
Inputs
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 a a))
Outputs
(sqrt.f64 (-.f64 (*.f64 a a) (*.f64 b b)))
#s(approx (sqrt (- (* a a) (* b b))) (*.f64 a a))

soundness0.0ms (0%)

Memory
0.6MiB live, 0.6MiB allocated
Stop Event
done
Compiler

Compiled 20 to 11 computations (45% saved)

preprocess25.0ms (2.8%)

Memory
-4.2MiB live, 35.0MiB allocated
Compiler

Compiled 82 to 52 computations (36.6% saved)

end0.0ms (0%)

Memory
0.0MiB live, 0.0MiB allocated

Profiling

Loading profile data...