Average Error: 13.6 → 1.2
Time: 34.5s
Precision: 64
Internal Precision: 128
\[wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\]
\[\frac{\frac{x}{e^{wj}}}{1 + wj} + \left(\left(\sqrt{\sqrt[3]{{wj}^{2} + {wj}^{4}}} \cdot \left(\sqrt{\sqrt[3]{{wj}^{2} + {wj}^{4}}} \cdot \sqrt[3]{{wj}^{2} + {wj}^{4}}\right)\right) \cdot \sqrt[3]{{wj}^{2} + {wj}^{4}} - {wj}^{3}\right)\]

Error

Bits error versus wj

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original13.6
Target12.9
Herbie1.2
\[wj - \left(\frac{wj}{wj + 1} - \frac{x}{e^{wj} + wj \cdot e^{wj}}\right)\]

Derivation

  1. Initial program 13.6

    \[wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\]
  2. Initial simplification6.9

    \[\leadsto \left(wj - \frac{wj}{wj + 1}\right) + \frac{\frac{x}{e^{wj}}}{wj + 1}\]
  3. Taylor expanded around 0 1.1

    \[\leadsto \color{blue}{\left(\left({wj}^{2} + {wj}^{4}\right) - {wj}^{3}\right)} + \frac{\frac{x}{e^{wj}}}{wj + 1}\]
  4. Using strategy rm
  5. Applied add-cube-cbrt1.2

    \[\leadsto \left(\color{blue}{\left(\sqrt[3]{{wj}^{2} + {wj}^{4}} \cdot \sqrt[3]{{wj}^{2} + {wj}^{4}}\right) \cdot \sqrt[3]{{wj}^{2} + {wj}^{4}}} - {wj}^{3}\right) + \frac{\frac{x}{e^{wj}}}{wj + 1}\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt1.2

    \[\leadsto \left(\left(\sqrt[3]{{wj}^{2} + {wj}^{4}} \cdot \color{blue}{\left(\sqrt{\sqrt[3]{{wj}^{2} + {wj}^{4}}} \cdot \sqrt{\sqrt[3]{{wj}^{2} + {wj}^{4}}}\right)}\right) \cdot \sqrt[3]{{wj}^{2} + {wj}^{4}} - {wj}^{3}\right) + \frac{\frac{x}{e^{wj}}}{wj + 1}\]
  8. Applied associate-*r*1.2

    \[\leadsto \left(\color{blue}{\left(\left(\sqrt[3]{{wj}^{2} + {wj}^{4}} \cdot \sqrt{\sqrt[3]{{wj}^{2} + {wj}^{4}}}\right) \cdot \sqrt{\sqrt[3]{{wj}^{2} + {wj}^{4}}}\right)} \cdot \sqrt[3]{{wj}^{2} + {wj}^{4}} - {wj}^{3}\right) + \frac{\frac{x}{e^{wj}}}{wj + 1}\]
  9. Final simplification1.2

    \[\leadsto \frac{\frac{x}{e^{wj}}}{1 + wj} + \left(\left(\sqrt{\sqrt[3]{{wj}^{2} + {wj}^{4}}} \cdot \left(\sqrt{\sqrt[3]{{wj}^{2} + {wj}^{4}}} \cdot \sqrt[3]{{wj}^{2} + {wj}^{4}}\right)\right) \cdot \sqrt[3]{{wj}^{2} + {wj}^{4}} - {wj}^{3}\right)\]

Reproduce

herbie shell --seed 2018365 
(FPCore (wj x)
  :name "Jmat.Real.lambertw, newton loop step"

  :herbie-target
  (- wj (- (/ wj (+ wj 1)) (/ x (+ (exp wj) (* wj (exp wj))))))

  (- wj (/ (- (* wj (exp wj)) x) (+ (exp wj) (* wj (exp wj))))))

Details

Time bar (total: 18.8s)Debug log

start453.0ms

Algorithm
intervals

setup609.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 8.1b

localize22.0ms

Local error

Found 4 expressions with local error:

6.1b
(- wj (/ wj (+ wj 1)))
0.0b
(/ (/ x (exp wj)) (+ wj 1))
0.0b
(/ wj (+ wj 1))
0.0b
(/ x (exp wj))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
4 → 73
Calls

4 calls. Slowest were:

3.0ms
(/ (/ x (exp wj)) (+ wj 1))
1.0ms
(/ x (exp wj))
1.0ms
(/ wj (+ wj 1))

series161.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

69.0ms
(/ (/ x (exp wj)) (+ wj 1))
52.0ms
(/ x (exp wj))
25.0ms
(- wj (/ wj (+ wj 1)))
16.0ms
(/ wj (+ wj 1))

simplify1.4s

Counts
53 → 85
Calls

53 calls. Slowest were:

403.0ms
(/ (* (* (/ x (exp wj)) (/ x (exp wj))) (/ x (exp wj))) (* (* (+ wj 1) (+ wj 1)) (+ wj 1)))
178.0ms
(- (+ x (* 5/2 (* x (pow wj 2)))) (* 2 (* x wj)))
98.0ms
(- (+ x (* 1/2 (* x (pow wj 2)))) (* x wj))

prune1.2s

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.1b

localize21.0ms

Local error

Found 4 expressions with local error:

0.0b
(/ (/ x (exp wj)) (+ wj 1))
0.0b
(/ x (exp wj))
0.0b
(- (+ (pow wj 2) (pow wj 4)) (pow wj 3))
0.0b
(+ (pow wj 2) (pow wj 4))

rewrite30.0ms

Algorithm
rewrite-expression-head
Counts
4 → 76
Calls

4 calls. Slowest were:

22.0ms
(- (+ (pow wj 2) (pow wj 4)) (pow wj 3))
4.0ms
(/ (/ x (exp wj)) (+ wj 1))
3.0ms
(+ (pow wj 2) (pow wj 4))

series191.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

60.0ms
(/ (/ x (exp wj)) (+ wj 1))
57.0ms
(/ x (exp wj))
51.0ms
(+ (pow wj 2) (pow wj 4))
22.0ms
(- (+ (pow wj 2) (pow wj 4)) (pow wj 3))

simplify1.5s

Counts
57 → 88
Calls

57 calls. Slowest were:

464.0ms
(/ (* (* (/ x (exp wj)) (/ x (exp wj))) (/ x (exp wj))) (* (* (+ wj 1) (+ wj 1)) (+ wj 1)))
194.0ms
(- (+ x (* 5/2 (* x (pow wj 2)))) (* 2 (* x wj)))
105.0ms
(- (+ x (* 1/2 (* x (pow wj 2)))) (* x wj))

prune1.6s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.1b

localize35.0ms

Local error

Found 4 expressions with local error:

30.1b
(cbrt (+ (pow wj 2) (pow wj 4)))
30.1b
(cbrt (+ (pow wj 2) (pow wj 4)))
30.1b
(cbrt (+ (pow wj 2) (pow wj 4)))
0.3b
(* (cbrt (+ (pow wj 2) (pow wj 4))) (cbrt (+ (pow wj 2) (pow wj 4))))

rewrite23.0ms

Algorithm
rewrite-expression-head
Counts
4 → 80
Calls

4 calls. Slowest were:

11.0ms
(* (cbrt (+ (pow wj 2) (pow wj 4))) (cbrt (+ (pow wj 2) (pow wj 4))))
4.0ms
(cbrt (+ (pow wj 2) (pow wj 4)))
4.0ms
(cbrt (+ (pow wj 2) (pow wj 4)))

series486.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

141.0ms
(cbrt (+ (pow wj 2) (pow wj 4)))
130.0ms
(* (cbrt (+ (pow wj 2) (pow wj 4))) (cbrt (+ (pow wj 2) (pow wj 4))))
111.0ms
(cbrt (+ (pow wj 2) (pow wj 4)))
104.0ms
(cbrt (+ (pow wj 2) (pow wj 4)))

simplify3.8s

Counts
64 → 92
Calls

64 calls. Slowest were:

345.0ms
(* (cbrt (- (* (pow wj 2) (pow wj 2)) (* (pow wj 4) (pow wj 4)))) (cbrt (+ (pow wj 2) (pow wj 4))))
341.0ms
(cbrt (- (* (pow wj 2) (pow wj 2)) (* (pow wj 4) (pow wj 4))))
339.0ms
(* (cbrt (- (* (pow wj 2) (pow wj 2)) (* (pow wj 4) (pow wj 4)))) (cbrt (- (* (pow wj 2) (pow wj 2)) (* (pow wj 4) (pow wj 4)))))

prune2.5s

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.1b

localize42.0ms

Local error

Found 4 expressions with local error:

30.1b
(cbrt (+ (pow wj 2) (pow wj 4)))
30.1b
(cbrt (+ (pow wj 2) (pow wj 4)))
30.1b
(cbrt (+ (pow wj 2) (pow wj 4)))
30.1b
(cbrt (+ (pow wj 2) (pow wj 4)))

rewrite17.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

4.0ms
(cbrt (+ (pow wj 2) (pow wj 4)))
4.0ms
(cbrt (+ (pow wj 2) (pow wj 4)))
4.0ms
(cbrt (+ (pow wj 2) (pow wj 4)))

series495.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

151.0ms
(cbrt (+ (pow wj 2) (pow wj 4)))
125.0ms
(cbrt (+ (pow wj 2) (pow wj 4)))
113.0ms
(cbrt (+ (pow wj 2) (pow wj 4)))
106.0ms
(cbrt (+ (pow wj 2) (pow wj 4)))

simplify2.0s

Counts
36 → 68
Calls

36 calls. Slowest were:

357.0ms
(cbrt (- (* (pow wj 2) (pow wj 2)) (* (pow wj 4) (pow wj 4))))
323.0ms
(cbrt (- (* (pow wj 2) (pow wj 2)) (* (pow wj 4) (pow wj 4))))
320.0ms
(cbrt (- (* (pow wj 2) (pow wj 2)) (* (pow wj 4) (pow wj 4))))

prune1.8s

Pruning

8 alts after pruning (7 fresh and 1 done)

Merged error: 0.1b

regimes371.0ms

Accuracy

0% (1.2b remaining)

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

bsearch3.0ms