Average Error: 0.3 → 0.3
Time: 51.8s
Precision: 64
Internal Precision: 128
\[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\]
\[\left(\log \left(\sqrt[3]{x + y}\right) + \left((\left(a - 0.5\right) \cdot \left(\log t\right) + \left(\log z\right))_* - t\right)\right) + \log \left(\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}\right)\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Derivation

  1. Initial program 0.3

    \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\]
  2. Simplified0.3

    \[\leadsto \color{blue}{\log \left(y + x\right) + \left((\left(a - 0.5\right) \cdot \left(\log t\right) + \left(\log z\right))_* - t\right)}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.3

    \[\leadsto \log \color{blue}{\left(\left(\sqrt[3]{y + x} \cdot \sqrt[3]{y + x}\right) \cdot \sqrt[3]{y + x}\right)} + \left((\left(a - 0.5\right) \cdot \left(\log t\right) + \left(\log z\right))_* - t\right)\]
  5. Applied log-prod0.3

    \[\leadsto \color{blue}{\left(\log \left(\sqrt[3]{y + x} \cdot \sqrt[3]{y + x}\right) + \log \left(\sqrt[3]{y + x}\right)\right)} + \left((\left(a - 0.5\right) \cdot \left(\log t\right) + \left(\log z\right))_* - t\right)\]
  6. Applied associate-+l+0.3

    \[\leadsto \color{blue}{\log \left(\sqrt[3]{y + x} \cdot \sqrt[3]{y + x}\right) + \left(\log \left(\sqrt[3]{y + x}\right) + \left((\left(a - 0.5\right) \cdot \left(\log t\right) + \left(\log z\right))_* - t\right)\right)}\]
  7. Final simplification0.3

    \[\leadsto \left(\log \left(\sqrt[3]{x + y}\right) + \left((\left(a - 0.5\right) \cdot \left(\log t\right) + \left(\log z\right))_* - t\right)\right) + \log \left(\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}\right)\]

Reproduce

herbie shell --seed 2019010 +o rules:numerics
(FPCore (x y z t a)
  :name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
  (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))

Details

Time bar (total: 49.8s)Debug log

sample538.0ms

Algorithm
intervals

simplify426.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
426.0ms
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t)))

prune26.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.2b

localize51.0ms

Local error

Found 3 expressions with local error:

0.4b
(fma (- a 0.5) (log t) (log z))
0.1b
(+ (log (+ y x)) (- (fma (- a 0.5) (log t) (log z)) t))
0.0b
(- (fma (- a 0.5) (log t) (log z)) t)

rewrite14.0ms

Algorithm
rewrite-expression-head
Rules
*-un-lft-identity
add-cube-cbrt
add-sqr-sqrt
pow1
add-log-exp
fma-def
log1p-expm1-u
fma-udef
add-exp-log
fma-neg
add-cbrt-cube
log-prod
associate-+r+
associate-+l+
expm1-log1p-u
distribute-lft-out
flip-+
associate-+l-
log-pow
associate--l+
flip3-+
sub-neg
log-div
flip--
flip3--
sum-log
associate-+r-
+-commutative
Counts
3 → 55
Calls
3 calls:
Slowest
10.0ms
(+ (log (+ y x)) (- (fma (- a 0.5) (log t) (log z)) t))
4.0ms
(- (fma (- a 0.5) (log t) (log z)) t)
0.0ms
(fma (- a 0.5) (log t) (log z))

series320.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
151.0ms
(+ (log (+ y x)) (- (fma (- a 0.5) (log t) (log z)) t))
106.0ms
(fma (- a 0.5) (log t) (log z))
64.0ms
(- (fma (- a 0.5) (log t) (log z)) t)

simplify3.4s

Counts
25 → 64
Calls
25 calls:
Slowest
503.0ms
(- (* 0.5 (log (/ 1 t))) (+ t (+ (log (/ 1 z)) (* a (log (/ 1 t))))))
492.0ms
(- (* 0.5 (log (/ 1 t))) (+ (log (/ 1 z)) (* a (log (/ 1 t)))))
404.0ms
(- (+ (* 0.5 (log (/ -1 t))) (+ (* a (log -1)) (* 0.5 (log -1)))) (+ t (+ (* a (log (/ -1 t))) (log (/ -1 z)))))
395.0ms
(- (+ (* a (log t)) (+ (log z) (log x))) (+ t (* 0.5 (log t))))
282.0ms
(- (+ (* 0.5 (log (/ -1 t))) (+ (* a (log -1)) (* 0.5 (log -1)))) (+ (* a (log (/ -1 t))) (log (/ -1 z))))

prune959.0ms

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0.1b

localize12.0ms

Local error

Found 4 expressions with local error:

0.3b
(+ (log (+ y x)) (* (- a 0.5) (log t)))
0.2b
(+ (+ (log (+ y x)) (* (- a 0.5) (log t))) (- (log z) t))
0.1b
(* (- a 0.5) (log t))
0.0b
(- (log z) t)

rewrite53.0ms

Algorithm
rewrite-expression-head
Rules
12×*-un-lft-identity
10×add-cube-cbrt
10×add-sqr-sqrt
add-log-exp
fma-def
pow1
flip-+
associate-+l-
add-exp-log
add-cbrt-cube
flip3-+
flip--
log1p-expm1-u
frac-add
flip3--
sum-log
associate-+l+
log-div
expm1-log1p-u
associate-*l*
associate-*r*
fma-neg
log-prod
associate-*l/
sub-neg
associate-+r+
+-commutative
distribute-lft-out
cbrt-unprod
*-commutative
log-pow
prod-exp
pow-prod-down
associate-+r-
Counts
4 → 87
Calls
4 calls:
Slowest
38.0ms
(+ (+ (log (+ y x)) (* (- a 0.5) (log t))) (- (log z) t))
6.0ms
(+ (log (+ y x)) (* (- a 0.5) (log t)))
5.0ms
(* (- a 0.5) (log t))
3.0ms
(- (log z) t)

series452.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
152.0ms
(+ (+ (log (+ y x)) (* (- a 0.5) (log t))) (- (log z) t))
139.0ms
(+ (log (+ y x)) (* (- a 0.5) (log t)))
82.0ms
(- (log z) t)
79.0ms
(* (- a 0.5) (log t))

simplify5.9s

Counts
50 → 99
Calls
50 calls:
Slowest
596.0ms
(- (* 0.5 (log (/ 1 t))) (+ (* a (log (/ 1 t))) (log (/ 1 y))))
501.0ms
(- (+ (* a (log t)) (+ (log z) (log x))) (+ t (* 0.5 (log t))))
429.0ms
(- (log -1) (+ t (log (/ -1 z))))
365.0ms
(* (- (log (+ y x)) (* (- a 0.5) (log t))) (+ (* (log z) (log z)) (+ (* t t) (* (log z) t))))
337.0ms
(* (* (+ y x) (exp (* (- a 0.5) (log t)))) (exp (- (log z) t)))

prune1.6s

Pruning

12 alts after pruning (12 fresh and 0 done)

Merged error: 0.0b

localize36.0ms

Local error

Found 4 expressions with local error:

0.6b
(cbrt (+ y x))
0.6b
(cbrt (+ y x))
0.6b
(cbrt (+ y x))
0.5b
(* (cbrt (+ y x)) (cbrt (+ y x)))

rewrite16.0ms

Algorithm
rewrite-expression-head
Rules
18×cbrt-div
15×cbrt-prod
11×add-cube-cbrt
11×*-un-lft-identity
11×add-sqr-sqrt
flip-+
flip3-+
pow1
pow1/3
add-exp-log
associate-*l*
associate-*r*
add-log-exp
log1p-expm1-u
add-cbrt-cube
frac-times
expm1-log1p-u
pow-prod-up
associate-*r/
associate-*l/
pow-prod-down
cbrt-unprod
*-commutative
prod-exp
pow-plus
pow2
Counts
4 → 83
Calls
4 calls:
Slowest
11.0ms
(* (cbrt (+ y x)) (cbrt (+ y x)))
1.0ms
(cbrt (+ y x))
1.0ms
(cbrt (+ y x))
1.0ms
(cbrt (+ y x))

series665.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
183.0ms
(* (cbrt (+ y x)) (cbrt (+ y x)))
167.0ms
(cbrt (+ y x))
167.0ms
(cbrt (+ y x))
148.0ms
(cbrt (+ y x))

simplify2.3s

Counts
59 → 95
Calls
59 calls:
Slowest
273.0ms
(- (+ (pow x 1/3) (* 1/3 (* (pow (/ 1 (pow x 2)) 1/3) y))) (* 1/9 (* (pow (/ 1 (pow x 5)) 1/3) (pow y 2))))
266.0ms
(- (+ (pow x 1/3) (* 1/3 (* (pow (/ 1 (pow x 2)) 1/3) y))) (* 1/9 (* (pow (/ 1 (pow x 5)) 1/3) (pow y 2))))
228.0ms
(- (+ (* 2/3 (* (pow (/ 1 x) 1/3) y)) (pow x 2/3)) (* 1/9 (* (pow (/ 1 (pow x 4)) 1/3) (pow y 2))))
195.0ms
(- (+ (pow x 1/3) (* 1/3 (* (pow (/ 1 (pow x 2)) 1/3) y))) (* 1/9 (* (pow (/ 1 (pow x 5)) 1/3) (pow y 2))))
159.0ms
(* (cbrt (- (* y y) (* x x))) (cbrt (+ (pow y 3) (pow x 3))))

prune2.0s

Pruning

12 alts after pruning (11 fresh and 1 done)

Merged error: 0.0b

localize35.0ms

Local error

Found 4 expressions with local error:

0.7b
(* (cbrt (- a 0.5)) (cbrt (- a 0.5)))
0.4b
(* (cbrt (- a 0.5)) (log t))
0.3b
(+ (log (+ y x)) (* (* (cbrt (- a 0.5)) (cbrt (- a 0.5))) (* (cbrt (- a 0.5)) (log t))))
0.3b
(* (* (cbrt (- a 0.5)) (cbrt (- a 0.5))) (* (cbrt (- a 0.5)) (log t)))

rewrite86.0ms

Algorithm
rewrite-expression-head
Rules
68×cbrt-div
36×associate-*l/
34×flip--
34×flip3--
32×frac-times
24×pow1
20×add-exp-log
13×add-cube-cbrt
13×associate-*l*
13×*-un-lft-identity
13×add-sqr-sqrt
11×pow-prod-down
11×add-cbrt-cube
10×cbrt-unprod
10×associate-*r/
10×prod-exp
10×associate-*r*
cbrt-prod
add-log-exp
log1p-expm1-u
pow1/3
fma-def
expm1-log1p-u
*-commutative
log-prod
associate-+l+
flip-+
associate-+l-
pow-prod-up
flip3-+
log-div
log-pow
pow-plus
sum-log
+-commutative
pow2
Counts
4 → 134
Calls
4 calls:
Slowest
47.0ms
(* (* (cbrt (- a 0.5)) (cbrt (- a 0.5))) (* (cbrt (- a 0.5)) (log t)))
15.0ms
(+ (log (+ y x)) (* (* (cbrt (- a 0.5)) (cbrt (- a 0.5))) (* (cbrt (- a 0.5)) (log t))))
11.0ms
(* (cbrt (- a 0.5)) (cbrt (- a 0.5)))
9.0ms
(* (cbrt (- a 0.5)) (log t))

series836.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
512.0ms
(* (cbrt (- a 0.5)) (log t))
170.0ms
(+ (log (+ y x)) (* (* (cbrt (- a 0.5)) (cbrt (- a 0.5))) (* (cbrt (- a 0.5)) (log t))))
77.0ms
(* (cbrt (- a 0.5)) (cbrt (- a 0.5)))
76.0ms
(* (* (cbrt (- a 0.5)) (cbrt (- a 0.5))) (* (cbrt (- a 0.5)) (log t)))

simplify10.7s

Counts
121 → 146
Calls
121 calls:
Slowest
763.0ms
(* (* (* (* (cbrt (- a 0.5)) (cbrt (- a 0.5))) (* (cbrt (- a 0.5)) (cbrt (- a 0.5)))) (* (cbrt (- a 0.5)) (cbrt (- a 0.5)))) (* (- a 0.5) (* (* (log t) (log t)) (log t))))
523.0ms
(- (* 0.5 (log (/ 1 t))) (+ (* a (log (/ 1 t))) (log (/ 1 y))))
465.0ms
(- (+ (* (log t) (pow -0.5 1/3)) (* 0.2222222222222222 (* (* (pow a 2) (log t)) (pow -0.5 1/3)))) (+ (* 0.6666666666666666 (* (* a (log t)) (pow -0.5 1/3))) (* 1/6 (* (* (pow a 2) (log t)) (pow -32.0 1/3)))))
433.0ms
(* (* (* (* (cbrt (- a 0.5)) (cbrt (- a 0.5))) (* (cbrt (- a 0.5)) (cbrt (- a 0.5)))) (* (cbrt (- a 0.5)) (cbrt (- a 0.5)))) (* (* (* (cbrt (- a 0.5)) (log t)) (* (cbrt (- a 0.5)) (log t))) (* (cbrt (- a 0.5)) (log t))))
378.0ms
(* (* (- a 0.5) (- a 0.5)) (* (- a 0.5) (* (* (log t) (log t)) (log t))))

prune2.7s

Pruning

12 alts after pruning (10 fresh and 2 done)

Merged error: 0.0b

regimes1.4s

Accuracy

0% (0.2b remaining)

Error of 0.3b against oracle of 0.1b and baseline of 0.3b

bsearch4.0ms

end0.0ms

sample15.1s

Algorithm
intervals