Average Error: 31.6 → 0.5
Time: 18.7s
Precision: 64
Internal Precision: 128
\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\]
\[\left(\sqrt{\frac{1}{\sqrt{\log 10}}} \cdot \left(\sqrt{\frac{1}{\sqrt{\log 10}}} \cdot \log \left(\sqrt{re^2 + im^2}^*\right)\right)\right) \cdot \frac{1}{\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 31.6

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

    \[\leadsto \color{blue}{\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 div-inv0.4

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

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

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

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

Reproduce

herbie shell --seed 2019008 +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: 17.6s)Debug log

sample50.0ms

Algorithm
intervals

simplify7.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

7.0ms
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10))

prune10.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.7b

localize13.0ms

Local error

Found 2 expressions with local error:

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

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
2 → 43
Calls

2 calls. Slowest were:

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

series201.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

165.0ms
(/ (log (hypot re im)) (log 10))
36.0ms
(hypot re im)

simplify454.0ms

Counts
37 → 49
Calls

37 calls. Slowest were:

128.0ms
(* -1 (/ (log (/ -1 re)) (log 10)))
115.0ms
(/ (* (* (log (hypot re im)) (log (hypot re im))) (log (hypot re im))) (* (* (log 10) (log 10)) (log 10)))
91.0ms
(* -1 (/ (log (/ 1 re)) (log 10)))

prune560.0ms

Pruning

13 alts after pruning (13 fresh and 0 done)

Merged error: 0.1b

localize11.0ms

Local error

Found 3 expressions with local error:

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

rewrite29.0ms

Algorithm
rewrite-expression-head
Counts
3 → 110
Calls

3 calls. Slowest were:

15.0ms
(* (/ 1 (sqrt (log 10))) (/ (log (hypot re im)) (sqrt (log 10))))
11.0ms
(/ (log (hypot re im)) (sqrt (log 10)))
0.0ms
(hypot re im)

series427.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

223.0ms
(/ (log (hypot re im)) (sqrt (log 10)))
168.0ms
(* (/ 1 (sqrt (log 10))) (/ (log (hypot re im)) (sqrt (log 10))))
35.0ms
(hypot re im)

simplify1.9s

Counts
108 → 119
Calls

108 calls. Slowest were:

420.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)))))
130.0ms
(+ (log (/ 1 (sqrt (log 10)))) (log (/ (log (hypot re im)) (sqrt (log 10)))))
125.0ms
(/ (* (* (log (hypot re im)) (log (hypot re im))) (log (hypot re im))) (* (* (sqrt (log 10)) (sqrt (log 10))) (sqrt (log 10))))

prune1.5s

Pruning

13 alts after pruning (13 fresh and 0 done)

Merged error: 0.0b

localize10.0ms

Local error

Found 3 expressions with local error:

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

rewrite17.0ms

Algorithm
rewrite-expression-head
Counts
3 → 64
Calls

3 calls. Slowest were:

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

series423.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

216.0ms
(* (log (hypot re im)) (/ 1 (sqrt (log 10))))
180.0ms
(* (/ 1 (sqrt (log 10))) (* (log (hypot re im)) (/ 1 (sqrt (log 10)))))
27.0ms
(hypot re im)

simplify2.7s

Counts
41 → 73
Calls

41 calls. Slowest were:

665.0ms
(* (* (* (log (hypot re im)) (log (hypot re im))) (log (hypot re im))) (* (* (/ 1 (sqrt (log 10))) (/ 1 (sqrt (log 10)))) (/ 1 (sqrt (log 10)))))
508.0ms
(* (* (* (/ 1 (sqrt (log 10))) (/ 1 (sqrt (log 10)))) (/ 1 (sqrt (log 10)))) (* (* (* (log (hypot re im)) (/ 1 (sqrt (log 10)))) (* (log (hypot re im)) (/ 1 (sqrt (log 10))))) (* (log (hypot re im)) (/ 1 (sqrt (log 10))))))
290.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))) (* (* (/ 1 (sqrt (log 10))) (/ 1 (sqrt (log 10)))) (/ 1 (sqrt (log 10))))))

prune897.0ms

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0.0b

localize12.0ms

Local error

Found 4 expressions with local error:

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

rewrite97.0ms

Algorithm
rewrite-expression-head
Counts
4 → 96
Calls

4 calls. Slowest were:

58.0ms
(* (/ 1 (sqrt (log 10))) (* (* (log (hypot re im)) (sqrt (/ 1 (sqrt (log 10))))) (sqrt (/ 1 (sqrt (log 10))))))
26.0ms
(* (* (log (hypot re im)) (sqrt (/ 1 (sqrt (log 10))))) (sqrt (/ 1 (sqrt (log 10)))))
10.0ms
(* (log (hypot re im)) (sqrt (/ 1 (sqrt (log 10)))))

series760.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

347.0ms
(* (log (hypot re im)) (sqrt (/ 1 (sqrt (log 10)))))
214.0ms
(* (* (log (hypot re im)) (sqrt (/ 1 (sqrt (log 10))))) (sqrt (/ 1 (sqrt (log 10)))))
174.0ms
(* (/ 1 (sqrt (log 10))) (* (* (log (hypot re im)) (sqrt (/ 1 (sqrt (log 10))))) (sqrt (/ 1 (sqrt (log 10))))))
24.0ms
(hypot re im)

simplify4.5s

Counts
68 → 108
Calls

68 calls. Slowest were:

744.0ms
(* (* (* (/ 1 (sqrt (log 10))) (/ 1 (sqrt (log 10)))) (/ 1 (sqrt (log 10)))) (* (* (* (* (log (hypot re im)) (sqrt (/ 1 (sqrt (log 10))))) (sqrt (/ 1 (sqrt (log 10))))) (* (* (log (hypot re im)) (sqrt (/ 1 (sqrt (log 10))))) (sqrt (/ 1 (sqrt (log 10)))))) (* (* (log (hypot re im)) (sqrt (/ 1 (sqrt (log 10))))) (sqrt (/ 1 (sqrt (log 10)))))))
318.0ms
(* (* (* (log (hypot re im)) (log (hypot re im))) (log (hypot re im))) (* (* (sqrt (/ 1 (sqrt (log 10)))) (sqrt (/ 1 (sqrt (log 10))))) (sqrt (/ 1 (sqrt (log 10))))))
314.0ms
(+ (log (/ 1 (sqrt (log 10)))) (log (* (* (log (hypot re im)) (sqrt (/ 1 (sqrt (log 10))))) (sqrt (/ 1 (sqrt (log 10)))))))

prune1.5s

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 0.0b

regimes162.0ms

Accuracy

0% (0.5b remaining)

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

bsearch4.0ms

end0.0ms

sample1.4s

Algorithm
intervals