(FPCore (a b c d e) :precision binary64 (+ (+ (+ (+ e d) c) b) a))
(FPCore (a b c d e) :precision binary64 (log (* (* (* (* (exp e) (exp d)) (exp c)) (exp b)) (exp a))))
double code(double a, double b, double c, double d, double e) {
return (((e + d) + c) + b) + a;
}
double code(double a, double b, double c, double d, double e) {
return log(((((exp(e) * exp(d)) * exp(c)) * exp(b)) * exp(a)));
}
real(8) function code(a, b, c, d, e)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: d
real(8), intent (in) :: e
code = (((e + d) + c) + b) + a
end function
real(8) function code(a, b, c, d, e)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: d
real(8), intent (in) :: e
code = log(((((exp(e) * exp(d)) * exp(c)) * exp(b)) * exp(a)))
end function
public static double code(double a, double b, double c, double d, double e) {
return (((e + d) + c) + b) + a;
}
public static double code(double a, double b, double c, double d, double e) {
return Math.log(((((Math.exp(e) * Math.exp(d)) * Math.exp(c)) * Math.exp(b)) * Math.exp(a)));
}
def code(a, b, c, d, e): return (((e + d) + c) + b) + a
def code(a, b, c, d, e): return math.log(((((math.exp(e) * math.exp(d)) * math.exp(c)) * math.exp(b)) * math.exp(a)))
function code(a, b, c, d, e) return Float64(Float64(Float64(Float64(e + d) + c) + b) + a) end
function code(a, b, c, d, e) return log(Float64(Float64(Float64(Float64(exp(e) * exp(d)) * exp(c)) * exp(b)) * exp(a))) end
function tmp = code(a, b, c, d, e) tmp = (((e + d) + c) + b) + a; end
function tmp = code(a, b, c, d, e) tmp = log(((((exp(e) * exp(d)) * exp(c)) * exp(b)) * exp(a))); end
code[a_, b_, c_, d_, e_] := N[(N[(N[(N[(e + d), $MachinePrecision] + c), $MachinePrecision] + b), $MachinePrecision] + a), $MachinePrecision]
code[a_, b_, c_, d_, e_] := N[Log[N[(N[(N[(N[(N[Exp[e], $MachinePrecision] * N[Exp[d], $MachinePrecision]), $MachinePrecision] * N[Exp[c], $MachinePrecision]), $MachinePrecision] * N[Exp[b], $MachinePrecision]), $MachinePrecision] * N[Exp[a], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left(\left(\left(e + d\right) + c\right) + b\right) + a
\log \left(\left(\left(\left(e^{e} \cdot e^{d}\right) \cdot e^{c}\right) \cdot e^{b}\right) \cdot e^{a}\right)




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d




Bits error versus e
Results
| Original | 0.4 |
|---|---|
| Target | 0.2 |
| Herbie | 0.0 |
Initial program 0.4
Applied add-log-exp_binary640.4
Applied add-log-exp_binary640.4
Applied add-log-exp_binary640.4
Applied add-log-exp_binary640.4
Applied add-log-exp_binary640.4
Applied sum-log_binary640.4
Applied sum-log_binary640.3
Applied sum-log_binary640.2
Applied sum-log_binary640.0
Final simplification0.0
herbie shell --seed 2022129
(FPCore (a b c d e)
:name "Expression 1, p15"
:precision binary64
:pre (and (and (and (and (and (and (and (and (and (<= 1.0 a) (<= a 2.0)) (<= 2.0 b)) (<= b 4.0)) (<= 4.0 c)) (<= c 8.0)) (<= 8.0 d)) (<= d 16.0)) (<= 16.0 e)) (<= e 32.0))
:herbie-target
(+ (+ d (+ c (+ a b))) e)
(+ (+ (+ (+ e d) c) b) a))