Average Error: 0.0 → 0.0
Time: 1.4s
Precision: 64
$a + \left(b + \left(c + d\right)\right)$
$\left(\left(d + c\right) + b\right) + a$
a + \left(b + \left(c + d\right)\right)
\left(\left(d + c\right) + b\right) + a
double f(double a, double b, double c, double d) {
double r41375889 = a;
double r41375890 = b;
double r41375891 = c;
double r41375892 = d;
double r41375893 = r41375891 + r41375892;
double r41375894 = r41375890 + r41375893;
double r41375895 = r41375889 + r41375894;
return r41375895;
}


double f(double a, double b, double c, double d) {
double r41375896 = d;
double r41375897 = c;
double r41375898 = r41375896 + r41375897;
double r41375899 = b;
double r41375900 = r41375898 + r41375899;
double r41375901 = a;
double r41375902 = r41375900 + r41375901;
return r41375902;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.0

$a + \left(b + \left(c + d\right)\right)$
2. Final simplification0.0

$\leadsto \left(\left(d + c\right) + b\right) + a$

# Reproduce

herbie shell --seed 1
(FPCore (a b c d)
:name "(a+(b+(c+d)))"
(+ a (+ b (+ c d))))