| Alternative 1 | |
|---|---|
| Error | 93.21% |
| Cost | 45056 |
\[\log \left(e^{\frac{\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right)}{e^{x}}}\right)
\]
(FPCore (x) :precision binary64 (* (fmod (exp x) (sqrt (cos x))) (exp (- x))))
(FPCore (x)
:precision binary64
(let* ((t_0 (/ (fmod (exp x) (sqrt (cos x))) (exp x))) (t_1 (+ t_0 1.0)))
(/
(* (sqrt t_0) (sqrt (+ -1.0 (pow t_1 3.0))))
(sqrt (+ (pow t_1 2.0) (+ t_0 2.0))))))double code(double x) {
return fmod(exp(x), sqrt(cos(x))) * exp(-x);
}
double code(double x) {
double t_0 = fmod(exp(x), sqrt(cos(x))) / exp(x);
double t_1 = t_0 + 1.0;
return (sqrt(t_0) * sqrt((-1.0 + pow(t_1, 3.0)))) / sqrt((pow(t_1, 2.0) + (t_0 + 2.0)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = mod(exp(x), sqrt(cos(x))) * exp(-x)
end function
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
t_0 = mod(exp(x), sqrt(cos(x))) / exp(x)
t_1 = t_0 + 1.0d0
code = (sqrt(t_0) * sqrt(((-1.0d0) + (t_1 ** 3.0d0)))) / sqrt(((t_1 ** 2.0d0) + (t_0 + 2.0d0)))
end function
def code(x): return math.fmod(math.exp(x), math.sqrt(math.cos(x))) * math.exp(-x)
def code(x): t_0 = math.fmod(math.exp(x), math.sqrt(math.cos(x))) / math.exp(x) t_1 = t_0 + 1.0 return (math.sqrt(t_0) * math.sqrt((-1.0 + math.pow(t_1, 3.0)))) / math.sqrt((math.pow(t_1, 2.0) + (t_0 + 2.0)))
function code(x) return Float64(rem(exp(x), sqrt(cos(x))) * exp(Float64(-x))) end
function code(x) t_0 = Float64(rem(exp(x), sqrt(cos(x))) / exp(x)) t_1 = Float64(t_0 + 1.0) return Float64(Float64(sqrt(t_0) * sqrt(Float64(-1.0 + (t_1 ^ 3.0)))) / sqrt(Float64((t_1 ^ 2.0) + Float64(t_0 + 2.0)))) end
code[x_] := N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[Sqrt[N[Cos[x], $MachinePrecision]], $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[Sqrt[N[Cos[x], $MachinePrecision]], $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + 1.0), $MachinePrecision]}, N[(N[(N[Sqrt[t$95$0], $MachinePrecision] * N[Sqrt[N[(-1.0 + N[Power[t$95$1, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[t$95$1, 2.0], $MachinePrecision] + N[(t$95$0 + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x}
\begin{array}{l}
t_0 := \frac{\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right)}{e^{x}}\\
t_1 := t_0 + 1\\
\frac{\sqrt{t_0} \cdot \sqrt{-1 + {t_1}^{3}}}{\sqrt{{t_1}^{2} + \left(t_0 + 2\right)}}
\end{array}
Initial program 93.2
Simplified93.19
[Start]93.2 | \[ \left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x}
\] |
|---|---|
exp-neg [=>]93.2 | \[ \left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot \color{blue}{\frac{1}{e^{x}}}
\] |
associate-*r/ [=>]93.19 | \[ \color{blue}{\frac{\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot 1}{e^{x}}}
\] |
*-rgt-identity [=>]93.19 | \[ \frac{\color{blue}{\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right)}}{e^{x}}
\] |
Applied egg-rr93.21
Applied egg-rr93.21
Final simplification93.21
| Alternative 1 | |
|---|---|
| Error | 93.21% |
| Cost | 45056 |
| Alternative 2 | |
|---|---|
| Error | 93.18% |
| Cost | 38656 |
| Alternative 3 | |
|---|---|
| Error | 93.19% |
| Cost | 32256 |
| Alternative 4 | |
|---|---|
| Error | 93.39% |
| Cost | 19840 |
| Alternative 5 | |
|---|---|
| Error | 93.63% |
| Cost | 19456 |
| Alternative 6 | |
|---|---|
| Error | 94.06% |
| Cost | 13568 |
| Alternative 7 | |
|---|---|
| Error | 93.95% |
| Cost | 13568 |
| Alternative 8 | |
|---|---|
| Error | 94.07% |
| Cost | 13440 |
| Alternative 9 | |
|---|---|
| Error | 94.07% |
| Cost | 13184 |
| Alternative 10 | |
|---|---|
| Error | 94.53% |
| Cost | 12928 |
herbie shell --seed 2023125
(FPCore (x)
:name "expfmod (used to be hard to sample)"
:precision binary64
(* (fmod (exp x) (sqrt (cos x))) (exp (- x))))