| Alternative 1 | |
|---|---|
| Error | 0.3 |
| Cost | 26368 |
\[\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{{\left(e^{t}\right)}^{t}}\right)
\]
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (* (sqrt (* z 2.0)) (sqrt (pow E (* t t))))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0));
}
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * (sqrt((z * 2.0)) * sqrt(pow(((double) M_E), (t * t))));
}
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.exp(((t * t) / 2.0));
}
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * (Math.sqrt((z * 2.0)) * Math.sqrt(Math.pow(Math.E, (t * t))));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.exp(((t * t) / 2.0))
def code(x, y, z, t): return ((x * 0.5) - y) * (math.sqrt((z * 2.0)) * math.sqrt(math.pow(math.e, (t * t))))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * exp(Float64(Float64(t * t) / 2.0))) end
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * Float64(sqrt(Float64(z * 2.0)) * sqrt((exp(1) ^ Float64(t * t))))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0)); end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * (sqrt((z * 2.0)) * sqrt((2.71828182845904523536 ^ (t * t)))); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Power[E, N[(t * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{{e}^{\left(t \cdot t\right)}}\right)
Results
| Original | 0.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 0.3
Simplified0.3
[Start]0.3 | \[ \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\] |
|---|---|
associate-*l* [=>]0.3 | \[ \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)}
\] |
exp-sqrt [=>]0.3 | \[ \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{\sqrt{e^{t \cdot t}}}\right)
\] |
Applied egg-rr0.3
Simplified0.3
[Start]0.3 | \[ \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{{\left(e^{1}\right)}^{\left(t \cdot t\right)}}\right)
\] |
|---|---|
exp-1-e [=>]0.3 | \[ \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{{\color{blue}{e}}^{\left(t \cdot t\right)}}\right)
\] |
Final simplification0.3
| Alternative 1 | |
|---|---|
| Error | 0.3 |
| Cost | 26368 |
| Alternative 2 | |
|---|---|
| Error | 0.3 |
| Cost | 20032 |
| Alternative 3 | |
|---|---|
| Error | 0.3 |
| Cost | 19968 |
| Alternative 4 | |
|---|---|
| Error | 0.3 |
| Cost | 13632 |
| Alternative 5 | |
|---|---|
| Error | 0.9 |
| Cost | 7488 |
| Alternative 6 | |
|---|---|
| Error | 0.9 |
| Cost | 7488 |
| Alternative 7 | |
|---|---|
| Error | 0.9 |
| Cost | 7360 |
| Alternative 8 | |
|---|---|
| Error | 47.7 |
| Cost | 7044 |
| Alternative 9 | |
|---|---|
| Error | 49.0 |
| Cost | 6980 |
| Alternative 10 | |
|---|---|
| Error | 1.2 |
| Cost | 6976 |
| Alternative 11 | |
|---|---|
| Error | 53.5 |
| Cost | 6848 |
| Alternative 12 | |
|---|---|
| Error | 61.8 |
| Cost | 6720 |
herbie shell --seed 2022364
(FPCore (x y z t)
:name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
:precision binary64
:herbie-target
(* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (exp 1.0) (/ (* t t) 2.0)))
(* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))