
(FPCore (x) :precision binary64 (exp (- (- 1.0 (* x x)))))
double code(double x) {
return exp(-(1.0 - (x * x)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = exp(-(1.0d0 - (x * x)))
end function
public static double code(double x) {
return Math.exp(-(1.0 - (x * x)));
}
def code(x): return math.exp(-(1.0 - (x * x)))
function code(x) return exp(Float64(-Float64(1.0 - Float64(x * x)))) end
function tmp = code(x) tmp = exp(-(1.0 - (x * x))); end
code[x_] := N[Exp[(-N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision])], $MachinePrecision]
\begin{array}{l}
\\
e^{-\left(1 - x \cdot x\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary64 (exp (- (- 1.0 (* x x)))))
double code(double x) {
return exp(-(1.0 - (x * x)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = exp(-(1.0d0 - (x * x)))
end function
public static double code(double x) {
return Math.exp(-(1.0 - (x * x)));
}
def code(x): return math.exp(-(1.0 - (x * x)))
function code(x) return exp(Float64(-Float64(1.0 - Float64(x * x)))) end
function tmp = code(x) tmp = exp(-(1.0 - (x * x))); end
code[x_] := N[Exp[(-N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision])], $MachinePrecision]
\begin{array}{l}
\\
e^{-\left(1 - x \cdot x\right)}
\end{array}
(FPCore (x) :precision binary64 (exp (+ (* x x) -1.0)))
double code(double x) {
return exp(((x * x) + -1.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = exp(((x * x) + (-1.0d0)))
end function
public static double code(double x) {
return Math.exp(((x * x) + -1.0));
}
def code(x): return math.exp(((x * x) + -1.0))
function code(x) return exp(Float64(Float64(x * x) + -1.0)) end
function tmp = code(x) tmp = exp(((x * x) + -1.0)); end
code[x_] := N[Exp[N[(N[(x * x), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{x \cdot x + -1}
\end{array}
Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
(FPCore (x) :precision binary64 (if (<= (* x x) 0.5) (exp -1.0) (exp (* x x))))
double code(double x) {
double tmp;
if ((x * x) <= 0.5) {
tmp = exp(-1.0);
} else {
tmp = exp((x * x));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if ((x * x) <= 0.5d0) then
tmp = exp((-1.0d0))
else
tmp = exp((x * x))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if ((x * x) <= 0.5) {
tmp = Math.exp(-1.0);
} else {
tmp = Math.exp((x * x));
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 0.5: tmp = math.exp(-1.0) else: tmp = math.exp((x * x)) return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 0.5) tmp = exp(-1.0); else tmp = exp(Float64(x * x)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x * x) <= 0.5) tmp = exp(-1.0); else tmp = exp((x * x)); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 0.5], N[Exp[-1.0], $MachinePrecision], N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 0.5:\\
\;\;\;\;e^{-1}\\
\mathbf{else}:\\
\;\;\;\;e^{x \cdot x}\\
\end{array}
\end{array}
if (*.f64 x x) < 0.5Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
exp-lowering-exp.f6498.9%
Simplified98.9%
if 0.5 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 0.5 (* x (* x 0.16666666666666666)))))
(if (<= (* x x) 0.5)
(exp -1.0)
(if (<= (* x x) 1e+150)
(+
1.0
(/
(* x (* x (- 1.0 (* x (* (* x t_0) (* (* x x) t_0))))))
(- 1.0 (* x (* x (+ 0.5 (* (* x x) 0.16666666666666666)))))))
(* x (* x (* (* x x) 0.5)))))))
double code(double x) {
double t_0 = 0.5 + (x * (x * 0.16666666666666666));
double tmp;
if ((x * x) <= 0.5) {
tmp = exp(-1.0);
} else if ((x * x) <= 1e+150) {
tmp = 1.0 + ((x * (x * (1.0 - (x * ((x * t_0) * ((x * x) * t_0)))))) / (1.0 - (x * (x * (0.5 + ((x * x) * 0.16666666666666666))))));
} else {
tmp = x * (x * ((x * x) * 0.5));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = 0.5d0 + (x * (x * 0.16666666666666666d0))
if ((x * x) <= 0.5d0) then
tmp = exp((-1.0d0))
else if ((x * x) <= 1d+150) then
tmp = 1.0d0 + ((x * (x * (1.0d0 - (x * ((x * t_0) * ((x * x) * t_0)))))) / (1.0d0 - (x * (x * (0.5d0 + ((x * x) * 0.16666666666666666d0))))))
else
tmp = x * (x * ((x * x) * 0.5d0))
end if
code = tmp
end function
public static double code(double x) {
double t_0 = 0.5 + (x * (x * 0.16666666666666666));
double tmp;
if ((x * x) <= 0.5) {
tmp = Math.exp(-1.0);
} else if ((x * x) <= 1e+150) {
tmp = 1.0 + ((x * (x * (1.0 - (x * ((x * t_0) * ((x * x) * t_0)))))) / (1.0 - (x * (x * (0.5 + ((x * x) * 0.16666666666666666))))));
} else {
tmp = x * (x * ((x * x) * 0.5));
}
return tmp;
}
def code(x): t_0 = 0.5 + (x * (x * 0.16666666666666666)) tmp = 0 if (x * x) <= 0.5: tmp = math.exp(-1.0) elif (x * x) <= 1e+150: tmp = 1.0 + ((x * (x * (1.0 - (x * ((x * t_0) * ((x * x) * t_0)))))) / (1.0 - (x * (x * (0.5 + ((x * x) * 0.16666666666666666)))))) else: tmp = x * (x * ((x * x) * 0.5)) return tmp
function code(x) t_0 = Float64(0.5 + Float64(x * Float64(x * 0.16666666666666666))) tmp = 0.0 if (Float64(x * x) <= 0.5) tmp = exp(-1.0); elseif (Float64(x * x) <= 1e+150) tmp = Float64(1.0 + Float64(Float64(x * Float64(x * Float64(1.0 - Float64(x * Float64(Float64(x * t_0) * Float64(Float64(x * x) * t_0)))))) / Float64(1.0 - Float64(x * Float64(x * Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666))))))); else tmp = Float64(x * Float64(x * Float64(Float64(x * x) * 0.5))); end return tmp end
function tmp_2 = code(x) t_0 = 0.5 + (x * (x * 0.16666666666666666)); tmp = 0.0; if ((x * x) <= 0.5) tmp = exp(-1.0); elseif ((x * x) <= 1e+150) tmp = 1.0 + ((x * (x * (1.0 - (x * ((x * t_0) * ((x * x) * t_0)))))) / (1.0 - (x * (x * (0.5 + ((x * x) * 0.16666666666666666)))))); else tmp = x * (x * ((x * x) * 0.5)); end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[(0.5 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 0.5], N[Exp[-1.0], $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 1e+150], N[(1.0 + N[(N[(x * N[(x * N[(1.0 - N[(x * N[(N[(x * t$95$0), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(x * N[(x * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\\
\mathbf{if}\;x \cdot x \leq 0.5:\\
\;\;\;\;e^{-1}\\
\mathbf{elif}\;x \cdot x \leq 10^{+150}:\\
\;\;\;\;1 + \frac{x \cdot \left(x \cdot \left(1 - x \cdot \left(\left(x \cdot t\_0\right) \cdot \left(\left(x \cdot x\right) \cdot t\_0\right)\right)\right)\right)}{1 - x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot 0.5\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 0.5Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
exp-lowering-exp.f6498.9%
Simplified98.9%
if 0.5 < (*.f64 x x) < 9.99999999999999981e149Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6440.3%
Simplified40.3%
*-commutativeN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr64.7%
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr64.7%
if 9.99999999999999981e149 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification96.8%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 0.5 (* x (* x 0.16666666666666666)))))
(if (<= (* x x) 1e+150)
(+
1.0
(/
(* x (* x (- 1.0 (* x (* (* x t_0) (* (* x x) t_0))))))
(- 1.0 (* x (* x (+ 0.5 (* (* x x) 0.16666666666666666)))))))
(* x (* x (* (* x x) 0.5))))))
double code(double x) {
double t_0 = 0.5 + (x * (x * 0.16666666666666666));
double tmp;
if ((x * x) <= 1e+150) {
tmp = 1.0 + ((x * (x * (1.0 - (x * ((x * t_0) * ((x * x) * t_0)))))) / (1.0 - (x * (x * (0.5 + ((x * x) * 0.16666666666666666))))));
} else {
tmp = x * (x * ((x * x) * 0.5));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = 0.5d0 + (x * (x * 0.16666666666666666d0))
if ((x * x) <= 1d+150) then
tmp = 1.0d0 + ((x * (x * (1.0d0 - (x * ((x * t_0) * ((x * x) * t_0)))))) / (1.0d0 - (x * (x * (0.5d0 + ((x * x) * 0.16666666666666666d0))))))
else
tmp = x * (x * ((x * x) * 0.5d0))
end if
code = tmp
end function
public static double code(double x) {
double t_0 = 0.5 + (x * (x * 0.16666666666666666));
double tmp;
if ((x * x) <= 1e+150) {
tmp = 1.0 + ((x * (x * (1.0 - (x * ((x * t_0) * ((x * x) * t_0)))))) / (1.0 - (x * (x * (0.5 + ((x * x) * 0.16666666666666666))))));
} else {
tmp = x * (x * ((x * x) * 0.5));
}
return tmp;
}
def code(x): t_0 = 0.5 + (x * (x * 0.16666666666666666)) tmp = 0 if (x * x) <= 1e+150: tmp = 1.0 + ((x * (x * (1.0 - (x * ((x * t_0) * ((x * x) * t_0)))))) / (1.0 - (x * (x * (0.5 + ((x * x) * 0.16666666666666666)))))) else: tmp = x * (x * ((x * x) * 0.5)) return tmp
function code(x) t_0 = Float64(0.5 + Float64(x * Float64(x * 0.16666666666666666))) tmp = 0.0 if (Float64(x * x) <= 1e+150) tmp = Float64(1.0 + Float64(Float64(x * Float64(x * Float64(1.0 - Float64(x * Float64(Float64(x * t_0) * Float64(Float64(x * x) * t_0)))))) / Float64(1.0 - Float64(x * Float64(x * Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666))))))); else tmp = Float64(x * Float64(x * Float64(Float64(x * x) * 0.5))); end return tmp end
function tmp_2 = code(x) t_0 = 0.5 + (x * (x * 0.16666666666666666)); tmp = 0.0; if ((x * x) <= 1e+150) tmp = 1.0 + ((x * (x * (1.0 - (x * ((x * t_0) * ((x * x) * t_0)))))) / (1.0 - (x * (x * (0.5 + ((x * x) * 0.16666666666666666)))))); else tmp = x * (x * ((x * x) * 0.5)); end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[(0.5 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 1e+150], N[(1.0 + N[(N[(x * N[(x * N[(1.0 - N[(x * N[(N[(x * t$95$0), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(x * N[(x * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\\
\mathbf{if}\;x \cdot x \leq 10^{+150}:\\
\;\;\;\;1 + \frac{x \cdot \left(x \cdot \left(1 - x \cdot \left(\left(x \cdot t\_0\right) \cdot \left(\left(x \cdot x\right) \cdot t\_0\right)\right)\right)\right)}{1 - x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot 0.5\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 9.99999999999999981e149Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6427.8%
Simplified27.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6420.5%
Simplified20.5%
*-commutativeN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr23.5%
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr23.5%
if 9.99999999999999981e149 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification53.4%
(FPCore (x) :precision binary64 (if (<= (* x x) 5e-10) 1.0 (* (* x x) (+ 1.0 (* (* x x) (+ 0.5 (* (* x x) 0.16666666666666666)))))))
double code(double x) {
double tmp;
if ((x * x) <= 5e-10) {
tmp = 1.0;
} else {
tmp = (x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if ((x * x) <= 5d-10) then
tmp = 1.0d0
else
tmp = (x * x) * (1.0d0 + ((x * x) * (0.5d0 + ((x * x) * 0.16666666666666666d0))))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if ((x * x) <= 5e-10) {
tmp = 1.0;
} else {
tmp = (x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))));
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 5e-10: tmp = 1.0 else: tmp = (x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666)))) return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 5e-10) tmp = 1.0; else tmp = Float64(Float64(x * x) * Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666))))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x * x) <= 5e-10) tmp = 1.0; else tmp = (x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666)))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-10], 1.0, N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-10}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 5.00000000000000031e-10Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6417.8%
Simplified17.8%
Taylor expanded in x around 0
Simplified17.8%
if 5.00000000000000031e-10 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6499.3%
Simplified99.3%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6489.9%
Simplified89.9%
Taylor expanded in x around inf
Simplified89.9%
(FPCore (x) :precision binary64 (if (<= (* x x) 0.5) 1.0 (* (+ 0.5 (* (* x x) 0.16666666666666666)) (* x (* x (* x x))))))
double code(double x) {
double tmp;
if ((x * x) <= 0.5) {
tmp = 1.0;
} else {
tmp = (0.5 + ((x * x) * 0.16666666666666666)) * (x * (x * (x * x)));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if ((x * x) <= 0.5d0) then
tmp = 1.0d0
else
tmp = (0.5d0 + ((x * x) * 0.16666666666666666d0)) * (x * (x * (x * x)))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if ((x * x) <= 0.5) {
tmp = 1.0;
} else {
tmp = (0.5 + ((x * x) * 0.16666666666666666)) * (x * (x * (x * x)));
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 0.5: tmp = 1.0 else: tmp = (0.5 + ((x * x) * 0.16666666666666666)) * (x * (x * (x * x))) return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 0.5) tmp = 1.0; else tmp = Float64(Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666)) * Float64(x * Float64(x * Float64(x * x)))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x * x) <= 0.5) tmp = 1.0; else tmp = (0.5 + ((x * x) * 0.16666666666666666)) * (x * (x * (x * x))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 0.5], 1.0, N[(N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 0.5:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 0.5Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6417.8%
Simplified17.8%
Taylor expanded in x around 0
Simplified17.8%
if 0.5 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6490.5%
Simplified90.5%
Taylor expanded in x around inf
Simplified90.5%
Final simplification51.6%
(FPCore (x) :precision binary64 (if (<= (* x x) 0.5) 1.0 (* (* x x) (* x (* 0.16666666666666666 (* x (* x x)))))))
double code(double x) {
double tmp;
if ((x * x) <= 0.5) {
tmp = 1.0;
} else {
tmp = (x * x) * (x * (0.16666666666666666 * (x * (x * x))));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if ((x * x) <= 0.5d0) then
tmp = 1.0d0
else
tmp = (x * x) * (x * (0.16666666666666666d0 * (x * (x * x))))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if ((x * x) <= 0.5) {
tmp = 1.0;
} else {
tmp = (x * x) * (x * (0.16666666666666666 * (x * (x * x))));
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 0.5: tmp = 1.0 else: tmp = (x * x) * (x * (0.16666666666666666 * (x * (x * x)))) return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 0.5) tmp = 1.0; else tmp = Float64(Float64(x * x) * Float64(x * Float64(0.16666666666666666 * Float64(x * Float64(x * x))))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x * x) <= 0.5) tmp = 1.0; else tmp = (x * x) * (x * (0.16666666666666666 * (x * (x * x)))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 0.5], 1.0, N[(N[(x * x), $MachinePrecision] * N[(x * N[(0.16666666666666666 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 0.5:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot \left(0.16666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 0.5Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6417.8%
Simplified17.8%
Taylor expanded in x around 0
Simplified17.8%
if 0.5 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6490.5%
Simplified90.5%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
cube-prodN/A
unpow2N/A
unpow3N/A
pow-sqrN/A
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified90.5%
Final simplification51.6%
(FPCore (x) :precision binary64 (+ 1.0 (* (* x x) (+ 1.0 (/ 1.0 (/ 6.0 (* x (* x (* x x)))))))))
double code(double x) {
return 1.0 + ((x * x) * (1.0 + (1.0 / (6.0 / (x * (x * (x * x)))))));
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0 + ((x * x) * (1.0d0 + (1.0d0 / (6.0d0 / (x * (x * (x * x)))))))
end function
public static double code(double x) {
return 1.0 + ((x * x) * (1.0 + (1.0 / (6.0 / (x * (x * (x * x)))))));
}
def code(x): return 1.0 + ((x * x) * (1.0 + (1.0 / (6.0 / (x * (x * (x * x)))))))
function code(x) return Float64(1.0 + Float64(Float64(x * x) * Float64(1.0 + Float64(1.0 / Float64(6.0 / Float64(x * Float64(x * Float64(x * x)))))))) end
function tmp = code(x) tmp = 1.0 + ((x * x) * (1.0 + (1.0 / (6.0 / (x * (x * (x * x))))))); end
code[x_] := N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(1.0 / N[(6.0 / N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \left(x \cdot x\right) \cdot \left(1 + \frac{1}{\frac{6}{x \cdot \left(x \cdot \left(x \cdot x\right)\right)}}\right)
\end{array}
Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6456.0%
Simplified56.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6451.6%
Simplified51.6%
*-commutativeN/A
flip-+N/A
associate-*l/N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
Applied egg-rr25.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6451.6%
Simplified51.6%
(FPCore (x) :precision binary64 (+ 1.0 (* (* x x) (+ 1.0 (* (* x x) (+ 0.5 (* x (* x 0.16666666666666666))))))))
double code(double x) {
return 1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + (x * (x * 0.16666666666666666))))));
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0 + ((x * x) * (1.0d0 + ((x * x) * (0.5d0 + (x * (x * 0.16666666666666666d0))))))
end function
public static double code(double x) {
return 1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + (x * (x * 0.16666666666666666))))));
}
def code(x): return 1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + (x * (x * 0.16666666666666666))))))
function code(x) return Float64(1.0 + Float64(Float64(x * x) * Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(x * Float64(x * 0.16666666666666666))))))) end
function tmp = code(x) tmp = 1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + (x * (x * 0.16666666666666666)))))); end
code[x_] := N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)
\end{array}
Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6456.0%
Simplified56.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6451.6%
Simplified51.6%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6451.6%
Applied egg-rr51.6%
Final simplification51.6%
(FPCore (x) :precision binary64 (if (<= (* x x) 5e-10) 1.0 (* x (* x (+ 1.0 (* (* x x) 0.5))))))
double code(double x) {
double tmp;
if ((x * x) <= 5e-10) {
tmp = 1.0;
} else {
tmp = x * (x * (1.0 + ((x * x) * 0.5)));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if ((x * x) <= 5d-10) then
tmp = 1.0d0
else
tmp = x * (x * (1.0d0 + ((x * x) * 0.5d0)))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if ((x * x) <= 5e-10) {
tmp = 1.0;
} else {
tmp = x * (x * (1.0 + ((x * x) * 0.5)));
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 5e-10: tmp = 1.0 else: tmp = x * (x * (1.0 + ((x * x) * 0.5))) return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 5e-10) tmp = 1.0; else tmp = Float64(x * Float64(x * Float64(1.0 + Float64(Float64(x * x) * 0.5)))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x * x) <= 5e-10) tmp = 1.0; else tmp = x * (x * (1.0 + ((x * x) * 0.5))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-10], 1.0, N[(x * N[(x * N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-10}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot 0.5\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 5.00000000000000031e-10Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6417.8%
Simplified17.8%
Taylor expanded in x around 0
Simplified17.8%
if 5.00000000000000031e-10 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6499.3%
Simplified99.3%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6484.4%
Simplified84.4%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
associate-*r*N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
associate-*l*N/A
distribute-rgt-inN/A
lft-mult-inverseN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6484.4%
Simplified84.4%
(FPCore (x) :precision binary64 (if (<= (* x x) 0.5) 1.0 (* x (* x (* (* x x) 0.5)))))
double code(double x) {
double tmp;
if ((x * x) <= 0.5) {
tmp = 1.0;
} else {
tmp = x * (x * ((x * x) * 0.5));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if ((x * x) <= 0.5d0) then
tmp = 1.0d0
else
tmp = x * (x * ((x * x) * 0.5d0))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if ((x * x) <= 0.5) {
tmp = 1.0;
} else {
tmp = x * (x * ((x * x) * 0.5));
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 0.5: tmp = 1.0 else: tmp = x * (x * ((x * x) * 0.5)) return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 0.5) tmp = 1.0; else tmp = Float64(x * Float64(x * Float64(Float64(x * x) * 0.5))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x * x) <= 0.5) tmp = 1.0; else tmp = x * (x * ((x * x) * 0.5)); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 0.5], 1.0, N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 0.5:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot 0.5\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 0.5Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6417.8%
Simplified17.8%
Taylor expanded in x around 0
Simplified17.8%
if 0.5 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6484.9%
Simplified84.9%
Taylor expanded in x around inf
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6484.9%
Simplified84.9%
(FPCore (x) :precision binary64 (if (<= (* x x) 0.2) 1.0 (* x x)))
double code(double x) {
double tmp;
if ((x * x) <= 0.2) {
tmp = 1.0;
} else {
tmp = x * x;
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if ((x * x) <= 0.2d0) then
tmp = 1.0d0
else
tmp = x * x
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if ((x * x) <= 0.2) {
tmp = 1.0;
} else {
tmp = x * x;
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 0.2: tmp = 1.0 else: tmp = x * x return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 0.2) tmp = 1.0; else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x * x) <= 0.2) tmp = 1.0; else tmp = x * x; end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 0.2], 1.0, N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 0.2:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 0.20000000000000001Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6417.8%
Simplified17.8%
Taylor expanded in x around 0
Simplified17.8%
if 0.20000000000000001 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6499.3%
Simplified99.3%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6458.6%
Simplified58.6%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6458.6%
Simplified58.6%
(FPCore (x) :precision binary64 (+ (* x x) 1.0))
double code(double x) {
return (x * x) + 1.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (x * x) + 1.0d0
end function
public static double code(double x) {
return (x * x) + 1.0;
}
def code(x): return (x * x) + 1.0
function code(x) return Float64(Float64(x * x) + 1.0) end
function tmp = code(x) tmp = (x * x) + 1.0; end
code[x_] := N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot x + 1
\end{array}
Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6456.0%
Simplified56.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6436.9%
Simplified36.9%
Final simplification36.9%
(FPCore (x) :precision binary64 1.0)
double code(double x) {
return 1.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0
end function
public static double code(double x) {
return 1.0;
}
def code(x): return 1.0
function code(x) return 1.0 end
function tmp = code(x) tmp = 1.0; end
code[x_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6456.0%
Simplified56.0%
Taylor expanded in x around 0
Simplified11.0%
herbie shell --seed 2024163
(FPCore (x)
:name "exp neg sub"
:precision binary64
(exp (- (- 1.0 (* x x)))))