Average Error: 30.9 → 0.5
Time: 16.5s
Precision: 64
Internal Precision: 128
\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\]
\[\frac{\frac{1}{\sqrt{\log 10}} \cdot \log \left(\sqrt{re^2 + im^2}^*\right)}{\sqrt{\log 10}}\]

Error

Bits error versus re

Bits error versus im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 30.9

    \[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\]
  2. Initial simplification0.6

    \[\leadsto \frac{\log \left(\sqrt{re^2 + im^2}^*\right)}{\log 10}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt0.6

    \[\leadsto \frac{\log \left(\sqrt{re^2 + im^2}^*\right)}{\color{blue}{\sqrt{\log 10} \cdot \sqrt{\log 10}}}\]
  5. Applied pow10.6

    \[\leadsto \frac{\log \color{blue}{\left({\left(\sqrt{re^2 + im^2}^*\right)}^{1}\right)}}{\sqrt{\log 10} \cdot \sqrt{\log 10}}\]
  6. Applied log-pow0.6

    \[\leadsto \frac{\color{blue}{1 \cdot \log \left(\sqrt{re^2 + im^2}^*\right)}}{\sqrt{\log 10} \cdot \sqrt{\log 10}}\]
  7. Applied times-frac0.5

    \[\leadsto \color{blue}{\frac{1}{\sqrt{\log 10}} \cdot \frac{\log \left(\sqrt{re^2 + im^2}^*\right)}{\sqrt{\log 10}}}\]
  8. Using strategy rm
  9. Applied associate-*r/0.5

    \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{\log 10}} \cdot \log \left(\sqrt{re^2 + im^2}^*\right)}{\sqrt{\log 10}}}\]
  10. Final simplification0.5

    \[\leadsto \frac{\frac{1}{\sqrt{\log 10}} \cdot \log \left(\sqrt{re^2 + im^2}^*\right)}{\sqrt{\log 10}}\]

Reproduce

herbie shell --seed 2018360 +o rules:numerics
(FPCore (re im)
  :name "math.log10 on complex, real part"
  (/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))

Details

Time bar (total: 12.1s)Debug log

start74.0ms

Algorithm
intervals

setup33.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.6b

localize26.0ms

Local error

Found 2 expressions with local error:

0.6b
(/ (log (hypot re im)) (log 10))
0.0b
(hypot re im)

rewrite29.0ms

Algorithm
rewrite-expression-head
Counts
2 → 43
Calls

2 calls. Slowest were:

27.0ms
(/ (log (hypot re im)) (log 10))
0.0ms
(hypot re im)

series166.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

139.0ms
(/ (log (hypot re im)) (log 10))
26.0ms
(hypot re im)

simplify432.0ms

Counts
37 → 49
Calls

37 calls. Slowest were:

136.0ms
(/ (* (* (log (hypot re im)) (log (hypot re im))) (log (hypot re im))) (* (* (log 10) (log 10)) (log 10)))
95.0ms
(* -1 (/ (log (/ -1 re)) (log 10)))
76.0ms
(* -1 (/ (log (/ 1 re)) (log 10)))

prune625.0ms

Pruning

12 alts after pruning (12 fresh and 0 done)

Merged error: 0.1b

localize21.0ms

Local error

Found 3 expressions with local error:

0.5b
(/ (log (hypot re im)) (sqrt (log 10)))
0.2b
(* (/ 1 (sqrt (log 10))) (/ (log (hypot re im)) (sqrt (log 10))))
0.0b
(hypot re im)

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
3 → 110
Calls

3 calls. Slowest were:

7.0ms
(* (/ 1 (sqrt (log 10))) (/ (log (hypot re im)) (sqrt (log 10))))
5.0ms
(/ (log (hypot re im)) (sqrt (log 10)))
0.0ms
(hypot re im)

series399.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

183.0ms
(/ (log (hypot re im)) (sqrt (log 10)))
177.0ms
(* (/ 1 (sqrt (log 10))) (/ (log (hypot re im)) (sqrt (log 10))))
39.0ms
(hypot re im)

simplify1.6s

Counts
108 → 119
Calls

108 calls. Slowest were:

269.0ms
(* (* (* (/ 1 (sqrt (log 10))) (/ 1 (sqrt (log 10)))) (/ 1 (sqrt (log 10)))) (* (* (/ (log (hypot re im)) (sqrt (log 10))) (/ (log (hypot re im)) (sqrt (log 10)))) (/ (log (hypot re im)) (sqrt (log 10)))))
182.0ms
(/ (* (* (log (hypot re im)) (log (hypot re im))) (log (hypot re im))) (* (* (sqrt (log 10)) (sqrt (log 10))) (sqrt (log 10))))
124.0ms
(* -1 (/ (log (/ 1 re)) (log 10)))

prune1.8s

Pruning

12 alts after pruning (12 fresh and 0 done)

Merged error: 0.0b

localize12.0ms

Local error

Found 3 expressions with local error:

0.5b
(/ (* (/ 1 (sqrt (log 10))) (log (hypot re im))) (sqrt (log 10)))
0.3b
(* (/ 1 (sqrt (log 10))) (log (hypot re im)))
0.0b
(hypot re im)

rewrite24.0ms

Algorithm
rewrite-expression-head
Counts
3 → 70
Calls

3 calls. Slowest were:

18.0ms
(/ (* (/ 1 (sqrt (log 10))) (log (hypot re im))) (sqrt (log 10)))
6.0ms
(* (/ 1 (sqrt (log 10))) (log (hypot re im)))
0.0ms
(hypot re im)

series433.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

243.0ms
(* (/ 1 (sqrt (log 10))) (log (hypot re im)))
166.0ms
(/ (* (/ 1 (sqrt (log 10))) (log (hypot re im))) (sqrt (log 10)))
23.0ms
(hypot re im)

simplify3.0s

Counts
51 → 79
Calls

51 calls. Slowest were:

977.0ms
(/ (* (* (* (/ 1 (sqrt (log 10))) (log (hypot re im))) (* (/ 1 (sqrt (log 10))) (log (hypot re im)))) (* (/ 1 (sqrt (log 10))) (log (hypot re im)))) (* (* (sqrt (log 10)) (sqrt (log 10))) (sqrt (log 10))))
749.0ms
(/ (* (* (* (/ 1 (sqrt (log 10))) (/ 1 (sqrt (log 10)))) (/ 1 (sqrt (log 10)))) (* (* (log (hypot re im)) (log (hypot re im))) (log (hypot re im)))) (* (* (sqrt (log 10)) (sqrt (log 10))) (sqrt (log 10))))
284.0ms
(* (* (* (/ 1 (sqrt (log 10))) (/ 1 (sqrt (log 10)))) (/ 1 (sqrt (log 10)))) (* (* (log (hypot re im)) (log (hypot re im))) (log (hypot re im))))

prune1.1s

Pruning

13 alts after pruning (12 fresh and 1 done)

Merged error: 0.0b

localize19.0ms

Local error

Found 4 expressions with local error:

0.5b
(cbrt (hypot re im))
0.5b
(cbrt (hypot re im))
0.5b
(cbrt (hypot re im))
0.5b
(* (cbrt (hypot re im)) (cbrt (hypot re im)))

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
4 → 69
Calls

4 calls. Slowest were:

6.0ms
(* (cbrt (hypot re im)) (cbrt (hypot re im)))
1.0ms
(cbrt (hypot re im))
1.0ms
(cbrt (hypot re im))

series547.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

153.0ms
(cbrt (hypot re im))
135.0ms
(cbrt (hypot re im))
131.0ms
(* (cbrt (hypot re im)) (cbrt (hypot re im)))
127.0ms
(cbrt (hypot re im))

simplify205.0ms

Counts
41 → 81
Calls

41 calls. Slowest were:

43.0ms
(+ (* 1/6 (* (pow re 2) (pow (/ 1 (pow im 5)) 1/3))) (pow im 1/3))
33.0ms
(+ (* 1/6 (* (pow re 2) (pow (/ 1 (pow im 5)) 1/3))) (pow im 1/3))
32.0ms
(+ (pow im 2/3) (* 1/3 (* (pow re 2) (pow (/ 1 (pow im 4)) 1/3))))

prune1.3s

Pruning

13 alts after pruning (11 fresh and 2 done)

Merged error: 0.0b

regimes247.0ms

Accuracy

0% (0.5b remaining)

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

bsearch4.0ms