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

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.2

    \[\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 *-un-lft-identity0.6

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

    \[\leadsto \color{blue}{\frac{1}{\sqrt{\log 10}} \cdot \frac{\log \left(\sqrt{re^2 + im^2}^*\right)}{\sqrt{\log 10}}}\]
  7. Using strategy rm
  8. 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)}\]
  9. Applied associate-*r*0.4

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

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

Reproduce

herbie shell --seed 2018362 +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.8s)Debug log

start58.0ms

Algorithm
intervals

setup20.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.6b

localize28.0ms

Local error

Found 2 expressions with local error:

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

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
2 → 43
Calls

2 calls. Slowest were:

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

series162.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify498.0ms

Counts
37 → 49
Calls

37 calls. Slowest were:

173.0ms
(/ (* (* (log (hypot re im)) (log (hypot re im))) (log (hypot re im))) (* (* (log 10) (log 10)) (log 10)))
94.0ms
(* -1 (/ (log (/ -1 re)) (log 10)))
94.0ms
(* -1 (/ (log (/ 1 re)) (log 10)))

prune665.0ms

Pruning

13 alts after pruning (13 fresh and 0 done)

Merged error: 0.1b

localize12.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)

rewrite16.0ms

Algorithm
rewrite-expression-head
Counts
3 → 110
Calls

3 calls. Slowest were:

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

series440.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

232.0ms
(/ (log (hypot re im)) (sqrt (log 10)))
168.0ms
(* (/ 1 (sqrt (log 10))) (/ (log (hypot re im)) (sqrt (log 10))))
41.0ms
(hypot re im)

simplify2.0s

Counts
108 → 119
Calls

108 calls. Slowest were:

440.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)))))
135.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)))))
132.0ms
(+ (log (/ 1 (sqrt (log 10)))) (log (/ (log (hypot re im)) (sqrt (log 10)))))

prune1.7s

Pruning

15 alts after pruning (15 fresh and 0 done)

Merged error: 0.0b

localize9.0ms

Local error

Found 3 expressions with local error:

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

rewrite22.0ms

Algorithm
rewrite-expression-head
Counts
3 → 68
Calls

3 calls. Slowest were:

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

series392.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

186.0ms
(* (* (/ 1 (sqrt (log 10))) (log (hypot re im))) (/ 1 (sqrt (log 10))))
182.0ms
(* (/ 1 (sqrt (log 10))) (log (hypot re im)))
24.0ms
(hypot re im)

simplify2.3s

Counts
46 → 77
Calls

46 calls. Slowest were:

302.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)))) (* (* (/ 1 (sqrt (log 10))) (/ 1 (sqrt (log 10)))) (/ 1 (sqrt (log 10)))))
297.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))))
288.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)))))

prune1.2s

Pruning

11 alts after pruning (10 fresh and 1 done)

Merged error: 0.0b

localize16.0ms

Local error

Found 4 expressions with local error:

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

rewrite80.0ms

Algorithm
rewrite-expression-head
Counts
4 → 102
Calls

4 calls. Slowest were:

55.0ms
(* (* (* (/ 1 (sqrt (log 10))) (log (hypot re im))) (sqrt (/ 1 (sqrt (log 10))))) (sqrt (/ 1 (sqrt (log 10)))))
17.0ms
(* (* (/ 1 (sqrt (log 10))) (log (hypot re im))) (sqrt (/ 1 (sqrt (log 10)))))
6.0ms
(* (/ 1 (sqrt (log 10))) (log (hypot re im)))

series964.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

585.0ms
(* (* (/ 1 (sqrt (log 10))) (log (hypot re im))) (sqrt (/ 1 (sqrt (log 10)))))
207.0ms
(* (/ 1 (sqrt (log 10))) (log (hypot re im)))
134.0ms
(* (* (* (/ 1 (sqrt (log 10))) (log (hypot re im))) (sqrt (/ 1 (sqrt (log 10))))) (sqrt (/ 1 (sqrt (log 10)))))
38.0ms
(hypot re im)

simplify5.1s

Counts
76 → 114
Calls

76 calls. Slowest were:

603.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 (/ 1 (sqrt (log 10)))) (sqrt (/ 1 (sqrt (log 10))))) (sqrt (/ 1 (sqrt (log 10))))))
510.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 (/ 1 (sqrt (log 10)))) (sqrt (/ 1 (sqrt (log 10))))) (sqrt (/ 1 (sqrt (log 10))))))
384.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.8s

Pruning

10 alts after pruning (8 fresh and 2 done)

Merged error: 0b

regimes182.0ms

Accuracy

0% (0.3b remaining)

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

bsearch2.0ms