
(FPCore (x y) :precision binary64 (* (cosh x) (/ (sin y) y)))
double code(double x, double y) {
return cosh(x) * (sin(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cosh(x) * (sin(y) / y)
end function
public static double code(double x, double y) {
return Math.cosh(x) * (Math.sin(y) / y);
}
def code(x, y): return math.cosh(x) * (math.sin(y) / y)
function code(x, y) return Float64(cosh(x) * Float64(sin(y) / y)) end
function tmp = code(x, y) tmp = cosh(x) * (sin(y) / y); end
code[x_, y_] := N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cosh x \cdot \frac{\sin y}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (* (cosh x) (/ (sin y) y)))
double code(double x, double y) {
return cosh(x) * (sin(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cosh(x) * (sin(y) / y)
end function
public static double code(double x, double y) {
return Math.cosh(x) * (Math.sin(y) / y);
}
def code(x, y): return math.cosh(x) * (math.sin(y) / y)
function code(x, y) return Float64(cosh(x) * Float64(sin(y) / y)) end
function tmp = code(x, y) tmp = cosh(x) * (sin(y) / y); end
code[x_, y_] := N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cosh x \cdot \frac{\sin y}{y}
\end{array}
(FPCore (x y) :precision binary64 (* (cosh x) (/ (sin y) y)))
double code(double x, double y) {
return cosh(x) * (sin(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cosh(x) * (sin(y) / y)
end function
public static double code(double x, double y) {
return Math.cosh(x) * (Math.sin(y) / y);
}
def code(x, y): return math.cosh(x) * (math.sin(y) / y)
function code(x, y) return Float64(cosh(x) * Float64(sin(y) / y)) end
function tmp = code(x, y) tmp = cosh(x) * (sin(y) / y); end
code[x_, y_] := N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cosh x \cdot \frac{\sin y}{y}
\end{array}
Initial program 99.9%
(FPCore (x y)
:precision binary64
(if (<= x 1.9e-16)
(/ (sin y) y)
(if (<= x 1e+121)
(cosh x)
(*
(+ 1.0 (* (* x x) (+ 0.5 (* (* x x) 0.041666666666666664))))
(+ 1.0 (* (* y y) -0.16666666666666666))))))
double code(double x, double y) {
double tmp;
if (x <= 1.9e-16) {
tmp = sin(y) / y;
} else if (x <= 1e+121) {
tmp = cosh(x);
} else {
tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 1.9d-16) then
tmp = sin(y) / y
else if (x <= 1d+121) then
tmp = cosh(x)
else
tmp = (1.0d0 + ((x * x) * (0.5d0 + ((x * x) * 0.041666666666666664d0)))) * (1.0d0 + ((y * y) * (-0.16666666666666666d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1.9e-16) {
tmp = Math.sin(y) / y;
} else if (x <= 1e+121) {
tmp = Math.cosh(x);
} else {
tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.9e-16: tmp = math.sin(y) / y elif x <= 1e+121: tmp = math.cosh(x) else: tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666)) return tmp
function code(x, y) tmp = 0.0 if (x <= 1.9e-16) tmp = Float64(sin(y) / y); elseif (x <= 1e+121) tmp = cosh(x); else tmp = Float64(Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(Float64(x * x) * 0.041666666666666664)))) * Float64(1.0 + Float64(Float64(y * y) * -0.16666666666666666))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.9e-16) tmp = sin(y) / y; elseif (x <= 1e+121) tmp = cosh(x); else tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.9e-16], N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, 1e+121], N[Cosh[x], $MachinePrecision], N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(y * y), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.9 \cdot 10^{-16}:\\
\;\;\;\;\frac{\sin y}{y}\\
\mathbf{elif}\;x \leq 10^{+121}:\\
\;\;\;\;\cosh x\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.041666666666666664\right)\right) \cdot \left(1 + \left(y \cdot y\right) \cdot -0.16666666666666666\right)\\
\end{array}
\end{array}
if x < 1.90000000000000006e-16Initial program 99.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6466.3%
Simplified66.3%
if 1.90000000000000006e-16 < x < 1.00000000000000004e121Initial program 100.0%
Taylor expanded in y around 0
Simplified88.9%
*-rgt-identityN/A
cosh-lowering-cosh.f6488.9%
Applied egg-rr88.9%
if 1.00000000000000004e121 < x Initial program 100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.1%
Simplified77.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.1%
Simplified77.1%
(FPCore (x y)
:precision binary64
(if (<= x 1.15e+121)
(cosh x)
(*
(+ 1.0 (* (* x x) (+ 0.5 (* (* x x) 0.041666666666666664))))
(+ 1.0 (* (* y y) -0.16666666666666666)))))
double code(double x, double y) {
double tmp;
if (x <= 1.15e+121) {
tmp = cosh(x);
} else {
tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 1.15d+121) then
tmp = cosh(x)
else
tmp = (1.0d0 + ((x * x) * (0.5d0 + ((x * x) * 0.041666666666666664d0)))) * (1.0d0 + ((y * y) * (-0.16666666666666666d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1.15e+121) {
tmp = Math.cosh(x);
} else {
tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.15e+121: tmp = math.cosh(x) else: tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666)) return tmp
function code(x, y) tmp = 0.0 if (x <= 1.15e+121) tmp = cosh(x); else tmp = Float64(Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(Float64(x * x) * 0.041666666666666664)))) * Float64(1.0 + Float64(Float64(y * y) * -0.16666666666666666))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.15e+121) tmp = cosh(x); else tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.15e+121], N[Cosh[x], $MachinePrecision], N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(y * y), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.15 \cdot 10^{+121}:\\
\;\;\;\;\cosh x\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.041666666666666664\right)\right) \cdot \left(1 + \left(y \cdot y\right) \cdot -0.16666666666666666\right)\\
\end{array}
\end{array}
if x < 1.1499999999999999e121Initial program 99.9%
Taylor expanded in y around 0
Simplified59.1%
*-rgt-identityN/A
cosh-lowering-cosh.f6459.1%
Applied egg-rr59.1%
if 1.1499999999999999e121 < x Initial program 100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.1%
Simplified77.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.1%
Simplified77.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (* x x) 0.001388888888888889))
(t_1 (* x (+ 0.5 (* x (* x (+ 0.041666666666666664 t_0)))))))
(if (<= x 7e+51)
(/ (- 1.0 (* (* x x) (* t_1 t_1))) (- 1.0 (* x t_1)))
(if (<= x 1e+121)
(+ 1.0 (* (* x x) (* (* x x) t_0)))
(*
(+ 1.0 (* (* x x) (+ 0.5 (* (* x x) 0.041666666666666664))))
(+ 1.0 (* (* y y) -0.16666666666666666)))))))
double code(double x, double y) {
double t_0 = (x * x) * 0.001388888888888889;
double t_1 = x * (0.5 + (x * (x * (0.041666666666666664 + t_0))));
double tmp;
if (x <= 7e+51) {
tmp = (1.0 - ((x * x) * (t_1 * t_1))) / (1.0 - (x * t_1));
} else if (x <= 1e+121) {
tmp = 1.0 + ((x * x) * ((x * x) * t_0));
} else {
tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x * x) * 0.001388888888888889d0
t_1 = x * (0.5d0 + (x * (x * (0.041666666666666664d0 + t_0))))
if (x <= 7d+51) then
tmp = (1.0d0 - ((x * x) * (t_1 * t_1))) / (1.0d0 - (x * t_1))
else if (x <= 1d+121) then
tmp = 1.0d0 + ((x * x) * ((x * x) * t_0))
else
tmp = (1.0d0 + ((x * x) * (0.5d0 + ((x * x) * 0.041666666666666664d0)))) * (1.0d0 + ((y * y) * (-0.16666666666666666d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (x * x) * 0.001388888888888889;
double t_1 = x * (0.5 + (x * (x * (0.041666666666666664 + t_0))));
double tmp;
if (x <= 7e+51) {
tmp = (1.0 - ((x * x) * (t_1 * t_1))) / (1.0 - (x * t_1));
} else if (x <= 1e+121) {
tmp = 1.0 + ((x * x) * ((x * x) * t_0));
} else {
tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666));
}
return tmp;
}
def code(x, y): t_0 = (x * x) * 0.001388888888888889 t_1 = x * (0.5 + (x * (x * (0.041666666666666664 + t_0)))) tmp = 0 if x <= 7e+51: tmp = (1.0 - ((x * x) * (t_1 * t_1))) / (1.0 - (x * t_1)) elif x <= 1e+121: tmp = 1.0 + ((x * x) * ((x * x) * t_0)) else: tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666)) return tmp
function code(x, y) t_0 = Float64(Float64(x * x) * 0.001388888888888889) t_1 = Float64(x * Float64(0.5 + Float64(x * Float64(x * Float64(0.041666666666666664 + t_0))))) tmp = 0.0 if (x <= 7e+51) tmp = Float64(Float64(1.0 - Float64(Float64(x * x) * Float64(t_1 * t_1))) / Float64(1.0 - Float64(x * t_1))); elseif (x <= 1e+121) tmp = Float64(1.0 + Float64(Float64(x * x) * Float64(Float64(x * x) * t_0))); else tmp = Float64(Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(Float64(x * x) * 0.041666666666666664)))) * Float64(1.0 + Float64(Float64(y * y) * -0.16666666666666666))); end return tmp end
function tmp_2 = code(x, y) t_0 = (x * x) * 0.001388888888888889; t_1 = x * (0.5 + (x * (x * (0.041666666666666664 + t_0)))); tmp = 0.0; if (x <= 7e+51) tmp = (1.0 - ((x * x) * (t_1 * t_1))) / (1.0 - (x * t_1)); elseif (x <= 1e+121) tmp = 1.0 + ((x * x) * ((x * x) * t_0)); else tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(0.5 + N[(x * N[(x * N[(0.041666666666666664 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 7e+51], N[(N[(1.0 - N[(N[(x * x), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1e+121], N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(y * y), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x \cdot x\right) \cdot 0.001388888888888889\\
t_1 := x \cdot \left(0.5 + x \cdot \left(x \cdot \left(0.041666666666666664 + t\_0\right)\right)\right)\\
\mathbf{if}\;x \leq 7 \cdot 10^{+51}:\\
\;\;\;\;\frac{1 - \left(x \cdot x\right) \cdot \left(t\_1 \cdot t\_1\right)}{1 - x \cdot t\_1}\\
\mathbf{elif}\;x \leq 10^{+121}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.041666666666666664\right)\right) \cdot \left(1 + \left(y \cdot y\right) \cdot -0.16666666666666666\right)\\
\end{array}
\end{array}
if x < 7e51Initial program 99.9%
Taylor expanded in y around 0
Simplified57.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-*.f6448.7%
Simplified48.7%
flip-+N/A
/-lowering-/.f64N/A
Applied egg-rr31.6%
if 7e51 < x < 1.00000000000000004e121Initial program 100.0%
Taylor expanded in y around 0
Simplified85.7%
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-*.f6485.7%
Simplified85.7%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6485.7%
Simplified85.7%
if 1.00000000000000004e121 < x Initial program 100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.1%
Simplified77.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.1%
Simplified77.1%
(FPCore (x y)
:precision binary64
(if (<= x 490.0)
(+
1.0
(/
1.0
(/
(+
2.0
(*
(* x x)
(+
-0.16666666666666666
(*
(* x x)
(+ 0.008333333333333333 (* (* x x) -0.0002314814814814815))))))
(* x x))))
(if (<= x 7.5e+61)
(* y (* y (+ -0.16666666666666666 (/ 1.0 (* y y)))))
(if (<= x 2.1e+121)
(+ 1.0 (* (* x x) (* (* x x) (* (* x x) 0.001388888888888889))))
(*
(+ 1.0 (* (* x x) (+ 0.5 (* (* x x) 0.041666666666666664))))
(+ 1.0 (* (* y y) -0.16666666666666666)))))))
double code(double x, double y) {
double tmp;
if (x <= 490.0) {
tmp = 1.0 + (1.0 / ((2.0 + ((x * x) * (-0.16666666666666666 + ((x * x) * (0.008333333333333333 + ((x * x) * -0.0002314814814814815)))))) / (x * x)));
} else if (x <= 7.5e+61) {
tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y))));
} else if (x <= 2.1e+121) {
tmp = 1.0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889)));
} else {
tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 490.0d0) then
tmp = 1.0d0 + (1.0d0 / ((2.0d0 + ((x * x) * ((-0.16666666666666666d0) + ((x * x) * (0.008333333333333333d0 + ((x * x) * (-0.0002314814814814815d0))))))) / (x * x)))
else if (x <= 7.5d+61) then
tmp = y * (y * ((-0.16666666666666666d0) + (1.0d0 / (y * y))))
else if (x <= 2.1d+121) then
tmp = 1.0d0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889d0)))
else
tmp = (1.0d0 + ((x * x) * (0.5d0 + ((x * x) * 0.041666666666666664d0)))) * (1.0d0 + ((y * y) * (-0.16666666666666666d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 490.0) {
tmp = 1.0 + (1.0 / ((2.0 + ((x * x) * (-0.16666666666666666 + ((x * x) * (0.008333333333333333 + ((x * x) * -0.0002314814814814815)))))) / (x * x)));
} else if (x <= 7.5e+61) {
tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y))));
} else if (x <= 2.1e+121) {
tmp = 1.0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889)));
} else {
tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 490.0: tmp = 1.0 + (1.0 / ((2.0 + ((x * x) * (-0.16666666666666666 + ((x * x) * (0.008333333333333333 + ((x * x) * -0.0002314814814814815)))))) / (x * x))) elif x <= 7.5e+61: tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y)))) elif x <= 2.1e+121: tmp = 1.0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889))) else: tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666)) return tmp
function code(x, y) tmp = 0.0 if (x <= 490.0) tmp = Float64(1.0 + Float64(1.0 / Float64(Float64(2.0 + Float64(Float64(x * x) * Float64(-0.16666666666666666 + Float64(Float64(x * x) * Float64(0.008333333333333333 + Float64(Float64(x * x) * -0.0002314814814814815)))))) / Float64(x * x)))); elseif (x <= 7.5e+61) tmp = Float64(y * Float64(y * Float64(-0.16666666666666666 + Float64(1.0 / Float64(y * y))))); elseif (x <= 2.1e+121) tmp = Float64(1.0 + Float64(Float64(x * x) * Float64(Float64(x * x) * Float64(Float64(x * x) * 0.001388888888888889)))); else tmp = Float64(Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(Float64(x * x) * 0.041666666666666664)))) * Float64(1.0 + Float64(Float64(y * y) * -0.16666666666666666))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 490.0) tmp = 1.0 + (1.0 / ((2.0 + ((x * x) * (-0.16666666666666666 + ((x * x) * (0.008333333333333333 + ((x * x) * -0.0002314814814814815)))))) / (x * x))); elseif (x <= 7.5e+61) tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y)))); elseif (x <= 2.1e+121) tmp = 1.0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889))); else tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 490.0], N[(1.0 + N[(1.0 / N[(N[(2.0 + N[(N[(x * x), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * N[(0.008333333333333333 + N[(N[(x * x), $MachinePrecision] * -0.0002314814814814815), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e+61], N[(y * N[(y * N[(-0.16666666666666666 + N[(1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.1e+121], N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(y * y), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 490:\\
\;\;\;\;1 + \frac{1}{\frac{2 + \left(x \cdot x\right) \cdot \left(-0.16666666666666666 + \left(x \cdot x\right) \cdot \left(0.008333333333333333 + \left(x \cdot x\right) \cdot -0.0002314814814814815\right)\right)}{x \cdot x}}\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+61}:\\
\;\;\;\;y \cdot \left(y \cdot \left(-0.16666666666666666 + \frac{1}{y \cdot y}\right)\right)\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+121}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.041666666666666664\right)\right) \cdot \left(1 + \left(y \cdot y\right) \cdot -0.16666666666666666\right)\\
\end{array}
\end{array}
if x < 490Initial program 99.9%
Taylor expanded in y around 0
Simplified55.7%
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.0%
Simplified51.0%
distribute-rgt-inN/A
flip-+N/A
*-commutativeN/A
associate-*l*N/A
fmm-defN/A
clear-numN/A
/-lowering-/.f64N/A
Applied egg-rr18.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified30.4%
if 490 < x < 7.5e61Initial program 100.0%
associate-*r/N/A
frac-2negN/A
neg-sub0N/A
flip--N/A
+-lft-identityN/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr45.5%
Taylor expanded in x around 0
Simplified1.8%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f641.3%
Simplified1.3%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6446.5%
Simplified46.5%
if 7.5e61 < x < 2.1000000000000002e121Initial program 100.0%
Taylor expanded in y around 0
Simplified92.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-*.f6492.3%
Simplified92.3%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6492.3%
Simplified92.3%
if 2.1000000000000002e121 < x Initial program 100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.1%
Simplified77.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.1%
Simplified77.1%
Final simplification40.6%
(FPCore (x y)
:precision binary64
(if (<= x 520.0)
(+
1.0
(*
(* x x)
(+
0.5
(* (* x x) (+ 0.041666666666666664 (* x (* x 0.001388888888888889)))))))
(if (<= x 7.5e+61)
(* y (* y (+ -0.16666666666666666 (/ 1.0 (* y y)))))
(if (<= x 1.6e+121)
(+ 1.0 (* (* x x) (* (* x x) (* (* x x) 0.001388888888888889))))
(*
(+ 1.0 (* (* x x) (+ 0.5 (* (* x x) 0.041666666666666664))))
(+ 1.0 (* (* y y) -0.16666666666666666)))))))
double code(double x, double y) {
double tmp;
if (x <= 520.0) {
tmp = 1.0 + ((x * x) * (0.5 + ((x * x) * (0.041666666666666664 + (x * (x * 0.001388888888888889))))));
} else if (x <= 7.5e+61) {
tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y))));
} else if (x <= 1.6e+121) {
tmp = 1.0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889)));
} else {
tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 520.0d0) then
tmp = 1.0d0 + ((x * x) * (0.5d0 + ((x * x) * (0.041666666666666664d0 + (x * (x * 0.001388888888888889d0))))))
else if (x <= 7.5d+61) then
tmp = y * (y * ((-0.16666666666666666d0) + (1.0d0 / (y * y))))
else if (x <= 1.6d+121) then
tmp = 1.0d0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889d0)))
else
tmp = (1.0d0 + ((x * x) * (0.5d0 + ((x * x) * 0.041666666666666664d0)))) * (1.0d0 + ((y * y) * (-0.16666666666666666d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 520.0) {
tmp = 1.0 + ((x * x) * (0.5 + ((x * x) * (0.041666666666666664 + (x * (x * 0.001388888888888889))))));
} else if (x <= 7.5e+61) {
tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y))));
} else if (x <= 1.6e+121) {
tmp = 1.0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889)));
} else {
tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 520.0: tmp = 1.0 + ((x * x) * (0.5 + ((x * x) * (0.041666666666666664 + (x * (x * 0.001388888888888889)))))) elif x <= 7.5e+61: tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y)))) elif x <= 1.6e+121: tmp = 1.0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889))) else: tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666)) return tmp
function code(x, y) tmp = 0.0 if (x <= 520.0) tmp = Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(Float64(x * x) * Float64(0.041666666666666664 + Float64(x * Float64(x * 0.001388888888888889))))))); elseif (x <= 7.5e+61) tmp = Float64(y * Float64(y * Float64(-0.16666666666666666 + Float64(1.0 / Float64(y * y))))); elseif (x <= 1.6e+121) tmp = Float64(1.0 + Float64(Float64(x * x) * Float64(Float64(x * x) * Float64(Float64(x * x) * 0.001388888888888889)))); else tmp = Float64(Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(Float64(x * x) * 0.041666666666666664)))) * Float64(1.0 + Float64(Float64(y * y) * -0.16666666666666666))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 520.0) tmp = 1.0 + ((x * x) * (0.5 + ((x * x) * (0.041666666666666664 + (x * (x * 0.001388888888888889)))))); elseif (x <= 7.5e+61) tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y)))); elseif (x <= 1.6e+121) tmp = 1.0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889))); else tmp = (1.0 + ((x * x) * (0.5 + ((x * x) * 0.041666666666666664)))) * (1.0 + ((y * y) * -0.16666666666666666)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 520.0], N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(N[(x * x), $MachinePrecision] * N[(0.041666666666666664 + N[(x * N[(x * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e+61], N[(y * N[(y * N[(-0.16666666666666666 + N[(1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e+121], N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(y * y), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 520:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+61}:\\
\;\;\;\;y \cdot \left(y \cdot \left(-0.16666666666666666 + \frac{1}{y \cdot y}\right)\right)\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+121}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.041666666666666664\right)\right) \cdot \left(1 + \left(y \cdot y\right) \cdot -0.16666666666666666\right)\\
\end{array}
\end{array}
if x < 520Initial program 99.9%
Taylor expanded in y around 0
Simplified55.7%
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.0%
Simplified51.0%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6451.0%
Applied egg-rr51.0%
if 520 < x < 7.5e61Initial program 100.0%
associate-*r/N/A
frac-2negN/A
neg-sub0N/A
flip--N/A
+-lft-identityN/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr45.5%
Taylor expanded in x around 0
Simplified1.8%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f641.3%
Simplified1.3%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6446.5%
Simplified46.5%
if 7.5e61 < x < 1.6e121Initial program 100.0%
Taylor expanded in y around 0
Simplified92.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-*.f6492.3%
Simplified92.3%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6492.3%
Simplified92.3%
if 1.6e121 < x Initial program 100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.1%
Simplified77.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.1%
Simplified77.1%
Final simplification56.5%
(FPCore (x y)
:precision binary64
(if (<= x 540.0)
(+
1.0
(*
(* x x)
(+
0.5
(* (* x x) (+ 0.041666666666666664 (* x (* x 0.001388888888888889)))))))
(if (<= x 7.5e+61)
(* y (* y (+ -0.16666666666666666 (/ 1.0 (* y y)))))
(if (<= x 1.55e+131)
(+ 1.0 (* (* x x) (* (* x x) (* (* x x) 0.001388888888888889))))
(* (+ 1.0 (* (* x x) 0.5)) (+ 1.0 (* y (* y -0.16666666666666666))))))))
double code(double x, double y) {
double tmp;
if (x <= 540.0) {
tmp = 1.0 + ((x * x) * (0.5 + ((x * x) * (0.041666666666666664 + (x * (x * 0.001388888888888889))))));
} else if (x <= 7.5e+61) {
tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y))));
} else if (x <= 1.55e+131) {
tmp = 1.0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889)));
} else {
tmp = (1.0 + ((x * x) * 0.5)) * (1.0 + (y * (y * -0.16666666666666666)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 540.0d0) then
tmp = 1.0d0 + ((x * x) * (0.5d0 + ((x * x) * (0.041666666666666664d0 + (x * (x * 0.001388888888888889d0))))))
else if (x <= 7.5d+61) then
tmp = y * (y * ((-0.16666666666666666d0) + (1.0d0 / (y * y))))
else if (x <= 1.55d+131) then
tmp = 1.0d0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889d0)))
else
tmp = (1.0d0 + ((x * x) * 0.5d0)) * (1.0d0 + (y * (y * (-0.16666666666666666d0))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 540.0) {
tmp = 1.0 + ((x * x) * (0.5 + ((x * x) * (0.041666666666666664 + (x * (x * 0.001388888888888889))))));
} else if (x <= 7.5e+61) {
tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y))));
} else if (x <= 1.55e+131) {
tmp = 1.0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889)));
} else {
tmp = (1.0 + ((x * x) * 0.5)) * (1.0 + (y * (y * -0.16666666666666666)));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 540.0: tmp = 1.0 + ((x * x) * (0.5 + ((x * x) * (0.041666666666666664 + (x * (x * 0.001388888888888889)))))) elif x <= 7.5e+61: tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y)))) elif x <= 1.55e+131: tmp = 1.0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889))) else: tmp = (1.0 + ((x * x) * 0.5)) * (1.0 + (y * (y * -0.16666666666666666))) return tmp
function code(x, y) tmp = 0.0 if (x <= 540.0) tmp = Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(Float64(x * x) * Float64(0.041666666666666664 + Float64(x * Float64(x * 0.001388888888888889))))))); elseif (x <= 7.5e+61) tmp = Float64(y * Float64(y * Float64(-0.16666666666666666 + Float64(1.0 / Float64(y * y))))); elseif (x <= 1.55e+131) tmp = Float64(1.0 + Float64(Float64(x * x) * Float64(Float64(x * x) * Float64(Float64(x * x) * 0.001388888888888889)))); else tmp = Float64(Float64(1.0 + Float64(Float64(x * x) * 0.5)) * Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 540.0) tmp = 1.0 + ((x * x) * (0.5 + ((x * x) * (0.041666666666666664 + (x * (x * 0.001388888888888889)))))); elseif (x <= 7.5e+61) tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y)))); elseif (x <= 1.55e+131) tmp = 1.0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889))); else tmp = (1.0 + ((x * x) * 0.5)) * (1.0 + (y * (y * -0.16666666666666666))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 540.0], N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(N[(x * x), $MachinePrecision] * N[(0.041666666666666664 + N[(x * N[(x * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e+61], N[(y * N[(y * N[(-0.16666666666666666 + N[(1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.55e+131], N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 540:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+61}:\\
\;\;\;\;y \cdot \left(y \cdot \left(-0.16666666666666666 + \frac{1}{y \cdot y}\right)\right)\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+131}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(x \cdot x\right) \cdot 0.5\right) \cdot \left(1 + y \cdot \left(y \cdot -0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if x < 540Initial program 99.9%
Taylor expanded in y around 0
Simplified55.7%
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.0%
Simplified51.0%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6451.0%
Applied egg-rr51.0%
if 540 < x < 7.5e61Initial program 100.0%
associate-*r/N/A
frac-2negN/A
neg-sub0N/A
flip--N/A
+-lft-identityN/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr45.5%
Taylor expanded in x around 0
Simplified1.8%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f641.3%
Simplified1.3%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6446.5%
Simplified46.5%
if 7.5e61 < x < 1.55000000000000008e131Initial program 100.0%
Taylor expanded in y around 0
Simplified92.9%
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-*.f6492.9%
Simplified92.9%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6492.9%
Simplified92.9%
if 1.55000000000000008e131 < x Initial program 100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.5%
Simplified76.5%
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-*.f6476.5%
Simplified76.5%
Taylor expanded in x around 0
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6473.9%
Simplified73.9%
Final simplification56.1%
(FPCore (x y)
:precision binary64
(if (<= x 690.0)
(+ 1.0 (* x (* x (+ 0.5 (* (* x x) 0.041666666666666664)))))
(if (<= x 7.5e+61)
(* y (* y (+ -0.16666666666666666 (/ 1.0 (* y y)))))
(if (<= x 1.55e+131)
(+ 1.0 (* (* x x) (* (* x x) (* (* x x) 0.001388888888888889))))
(* (+ 1.0 (* (* x x) 0.5)) (+ 1.0 (* y (* y -0.16666666666666666))))))))
double code(double x, double y) {
double tmp;
if (x <= 690.0) {
tmp = 1.0 + (x * (x * (0.5 + ((x * x) * 0.041666666666666664))));
} else if (x <= 7.5e+61) {
tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y))));
} else if (x <= 1.55e+131) {
tmp = 1.0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889)));
} else {
tmp = (1.0 + ((x * x) * 0.5)) * (1.0 + (y * (y * -0.16666666666666666)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 690.0d0) then
tmp = 1.0d0 + (x * (x * (0.5d0 + ((x * x) * 0.041666666666666664d0))))
else if (x <= 7.5d+61) then
tmp = y * (y * ((-0.16666666666666666d0) + (1.0d0 / (y * y))))
else if (x <= 1.55d+131) then
tmp = 1.0d0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889d0)))
else
tmp = (1.0d0 + ((x * x) * 0.5d0)) * (1.0d0 + (y * (y * (-0.16666666666666666d0))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 690.0) {
tmp = 1.0 + (x * (x * (0.5 + ((x * x) * 0.041666666666666664))));
} else if (x <= 7.5e+61) {
tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y))));
} else if (x <= 1.55e+131) {
tmp = 1.0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889)));
} else {
tmp = (1.0 + ((x * x) * 0.5)) * (1.0 + (y * (y * -0.16666666666666666)));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 690.0: tmp = 1.0 + (x * (x * (0.5 + ((x * x) * 0.041666666666666664)))) elif x <= 7.5e+61: tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y)))) elif x <= 1.55e+131: tmp = 1.0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889))) else: tmp = (1.0 + ((x * x) * 0.5)) * (1.0 + (y * (y * -0.16666666666666666))) return tmp
function code(x, y) tmp = 0.0 if (x <= 690.0) tmp = Float64(1.0 + Float64(x * Float64(x * Float64(0.5 + Float64(Float64(x * x) * 0.041666666666666664))))); elseif (x <= 7.5e+61) tmp = Float64(y * Float64(y * Float64(-0.16666666666666666 + Float64(1.0 / Float64(y * y))))); elseif (x <= 1.55e+131) tmp = Float64(1.0 + Float64(Float64(x * x) * Float64(Float64(x * x) * Float64(Float64(x * x) * 0.001388888888888889)))); else tmp = Float64(Float64(1.0 + Float64(Float64(x * x) * 0.5)) * Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 690.0) tmp = 1.0 + (x * (x * (0.5 + ((x * x) * 0.041666666666666664)))); elseif (x <= 7.5e+61) tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y)))); elseif (x <= 1.55e+131) tmp = 1.0 + ((x * x) * ((x * x) * ((x * x) * 0.001388888888888889))); else tmp = (1.0 + ((x * x) * 0.5)) * (1.0 + (y * (y * -0.16666666666666666))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 690.0], N[(1.0 + N[(x * N[(x * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e+61], N[(y * N[(y * N[(-0.16666666666666666 + N[(1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.55e+131], N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 690:\\
\;\;\;\;1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.041666666666666664\right)\right)\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+61}:\\
\;\;\;\;y \cdot \left(y \cdot \left(-0.16666666666666666 + \frac{1}{y \cdot y}\right)\right)\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+131}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(x \cdot x\right) \cdot 0.5\right) \cdot \left(1 + y \cdot \left(y \cdot -0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if x < 690Initial program 99.9%
Taylor expanded in y around 0
Simplified55.7%
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.0%
Simplified51.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-*.f6450.0%
Simplified50.0%
if 690 < x < 7.5e61Initial program 100.0%
associate-*r/N/A
frac-2negN/A
neg-sub0N/A
flip--N/A
+-lft-identityN/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr45.5%
Taylor expanded in x around 0
Simplified1.8%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f641.3%
Simplified1.3%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6446.5%
Simplified46.5%
if 7.5e61 < x < 1.55000000000000008e131Initial program 100.0%
Taylor expanded in y around 0
Simplified92.9%
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-*.f6492.9%
Simplified92.9%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6492.9%
Simplified92.9%
if 1.55000000000000008e131 < x Initial program 100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.5%
Simplified76.5%
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-*.f6476.5%
Simplified76.5%
Taylor expanded in x around 0
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6473.9%
Simplified73.9%
Final simplification55.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (* x (* x (+ 0.5 (* (* x x) 0.041666666666666664)))))))
(if (<= x 500.0)
t_0
(if (<= x 1.55e+69)
(* y (* y (+ -0.16666666666666666 (/ 1.0 (* y y)))))
(if (<= x 1.55e+131)
t_0
(*
(+ 1.0 (* (* x x) 0.5))
(+ 1.0 (* y (* y -0.16666666666666666)))))))))
double code(double x, double y) {
double t_0 = 1.0 + (x * (x * (0.5 + ((x * x) * 0.041666666666666664))));
double tmp;
if (x <= 500.0) {
tmp = t_0;
} else if (x <= 1.55e+69) {
tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y))));
} else if (x <= 1.55e+131) {
tmp = t_0;
} else {
tmp = (1.0 + ((x * x) * 0.5)) * (1.0 + (y * (y * -0.16666666666666666)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (x * (x * (0.5d0 + ((x * x) * 0.041666666666666664d0))))
if (x <= 500.0d0) then
tmp = t_0
else if (x <= 1.55d+69) then
tmp = y * (y * ((-0.16666666666666666d0) + (1.0d0 / (y * y))))
else if (x <= 1.55d+131) then
tmp = t_0
else
tmp = (1.0d0 + ((x * x) * 0.5d0)) * (1.0d0 + (y * (y * (-0.16666666666666666d0))))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (x * (x * (0.5 + ((x * x) * 0.041666666666666664))));
double tmp;
if (x <= 500.0) {
tmp = t_0;
} else if (x <= 1.55e+69) {
tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y))));
} else if (x <= 1.55e+131) {
tmp = t_0;
} else {
tmp = (1.0 + ((x * x) * 0.5)) * (1.0 + (y * (y * -0.16666666666666666)));
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (x * (x * (0.5 + ((x * x) * 0.041666666666666664)))) tmp = 0 if x <= 500.0: tmp = t_0 elif x <= 1.55e+69: tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y)))) elif x <= 1.55e+131: tmp = t_0 else: tmp = (1.0 + ((x * x) * 0.5)) * (1.0 + (y * (y * -0.16666666666666666))) return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(x * Float64(x * Float64(0.5 + Float64(Float64(x * x) * 0.041666666666666664))))) tmp = 0.0 if (x <= 500.0) tmp = t_0; elseif (x <= 1.55e+69) tmp = Float64(y * Float64(y * Float64(-0.16666666666666666 + Float64(1.0 / Float64(y * y))))); elseif (x <= 1.55e+131) tmp = t_0; else tmp = Float64(Float64(1.0 + Float64(Float64(x * x) * 0.5)) * Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666)))); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (x * (x * (0.5 + ((x * x) * 0.041666666666666664)))); tmp = 0.0; if (x <= 500.0) tmp = t_0; elseif (x <= 1.55e+69) tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y)))); elseif (x <= 1.55e+131) tmp = t_0; else tmp = (1.0 + ((x * x) * 0.5)) * (1.0 + (y * (y * -0.16666666666666666))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(x * N[(x * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 500.0], t$95$0, If[LessEqual[x, 1.55e+69], N[(y * N[(y * N[(-0.16666666666666666 + N[(1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.55e+131], t$95$0, N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.041666666666666664\right)\right)\\
\mathbf{if}\;x \leq 500:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+69}:\\
\;\;\;\;y \cdot \left(y \cdot \left(-0.16666666666666666 + \frac{1}{y \cdot y}\right)\right)\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+131}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(x \cdot x\right) \cdot 0.5\right) \cdot \left(1 + y \cdot \left(y \cdot -0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if x < 500 or 1.5499999999999999e69 < x < 1.55000000000000008e131Initial program 99.9%
Taylor expanded in y around 0
Simplified57.9%
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-*.f6453.6%
Simplified53.6%
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-*.f6452.2%
Simplified52.2%
if 500 < x < 1.5499999999999999e69Initial program 100.0%
associate-*r/N/A
frac-2negN/A
neg-sub0N/A
flip--N/A
+-lft-identityN/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr41.7%
Taylor expanded in x around 0
Simplified1.8%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f641.2%
Simplified1.2%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6442.6%
Simplified42.6%
if 1.55000000000000008e131 < x Initial program 100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.5%
Simplified76.5%
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-*.f6476.5%
Simplified76.5%
Taylor expanded in x around 0
associate-+r+N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6473.9%
Simplified73.9%
Final simplification54.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (* x (* x (+ 0.5 (* (* x x) 0.041666666666666664)))))))
(if (<= x 320.0)
t_0
(if (<= x 1.55e+69)
(* y (* y (+ -0.16666666666666666 (/ 1.0 (* y y)))))
t_0))))
double code(double x, double y) {
double t_0 = 1.0 + (x * (x * (0.5 + ((x * x) * 0.041666666666666664))));
double tmp;
if (x <= 320.0) {
tmp = t_0;
} else if (x <= 1.55e+69) {
tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (x * (x * (0.5d0 + ((x * x) * 0.041666666666666664d0))))
if (x <= 320.0d0) then
tmp = t_0
else if (x <= 1.55d+69) then
tmp = y * (y * ((-0.16666666666666666d0) + (1.0d0 / (y * y))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (x * (x * (0.5 + ((x * x) * 0.041666666666666664))));
double tmp;
if (x <= 320.0) {
tmp = t_0;
} else if (x <= 1.55e+69) {
tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (x * (x * (0.5 + ((x * x) * 0.041666666666666664)))) tmp = 0 if x <= 320.0: tmp = t_0 elif x <= 1.55e+69: tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y)))) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(x * Float64(x * Float64(0.5 + Float64(Float64(x * x) * 0.041666666666666664))))) tmp = 0.0 if (x <= 320.0) tmp = t_0; elseif (x <= 1.55e+69) tmp = Float64(y * Float64(y * Float64(-0.16666666666666666 + Float64(1.0 / Float64(y * y))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (x * (x * (0.5 + ((x * x) * 0.041666666666666664)))); tmp = 0.0; if (x <= 320.0) tmp = t_0; elseif (x <= 1.55e+69) tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y)))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(x * N[(x * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 320.0], t$95$0, If[LessEqual[x, 1.55e+69], N[(y * N[(y * N[(-0.16666666666666666 + N[(1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.041666666666666664\right)\right)\\
\mathbf{if}\;x \leq 320:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+69}:\\
\;\;\;\;y \cdot \left(y \cdot \left(-0.16666666666666666 + \frac{1}{y \cdot y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < 320 or 1.5499999999999999e69 < x Initial program 99.9%
Taylor expanded in y around 0
Simplified58.9%
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-*.f6455.1%
Simplified55.1%
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-*.f6453.9%
Simplified53.9%
if 320 < x < 1.5499999999999999e69Initial program 100.0%
associate-*r/N/A
frac-2negN/A
neg-sub0N/A
flip--N/A
+-lft-identityN/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr41.7%
Taylor expanded in x around 0
Simplified1.8%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f641.2%
Simplified1.2%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6442.6%
Simplified42.6%
Final simplification53.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (* (* x x) 0.5))))
(if (<= x 650.0)
t_0
(if (<= x 7e+151)
(* y (* y (+ -0.16666666666666666 (/ 1.0 (* y y)))))
t_0))))
double code(double x, double y) {
double t_0 = 1.0 + ((x * x) * 0.5);
double tmp;
if (x <= 650.0) {
tmp = t_0;
} else if (x <= 7e+151) {
tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + ((x * x) * 0.5d0)
if (x <= 650.0d0) then
tmp = t_0
else if (x <= 7d+151) then
tmp = y * (y * ((-0.16666666666666666d0) + (1.0d0 / (y * y))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + ((x * x) * 0.5);
double tmp;
if (x <= 650.0) {
tmp = t_0;
} else if (x <= 7e+151) {
tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + ((x * x) * 0.5) tmp = 0 if x <= 650.0: tmp = t_0 elif x <= 7e+151: tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y)))) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(Float64(x * x) * 0.5)) tmp = 0.0 if (x <= 650.0) tmp = t_0; elseif (x <= 7e+151) tmp = Float64(y * Float64(y * Float64(-0.16666666666666666 + Float64(1.0 / Float64(y * y))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + ((x * x) * 0.5); tmp = 0.0; if (x <= 650.0) tmp = t_0; elseif (x <= 7e+151) tmp = y * (y * (-0.16666666666666666 + (1.0 / (y * y)))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 650.0], t$95$0, If[LessEqual[x, 7e+151], N[(y * N[(y * N[(-0.16666666666666666 + N[(1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(x \cdot x\right) \cdot 0.5\\
\mathbf{if}\;x \leq 650:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+151}:\\
\;\;\;\;y \cdot \left(y \cdot \left(-0.16666666666666666 + \frac{1}{y \cdot y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < 650 or 7.0000000000000006e151 < x Initial program 99.9%
Taylor expanded in y around 0
Simplified58.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6447.1%
Simplified47.1%
if 650 < x < 7.0000000000000006e151Initial program 100.0%
associate-*r/N/A
frac-2negN/A
neg-sub0N/A
flip--N/A
+-lft-identityN/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr43.8%
Taylor expanded in x around 0
Simplified1.9%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6410.3%
Simplified10.3%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6435.8%
Simplified35.8%
Final simplification45.7%
(FPCore (x y) :precision binary64 (if (<= y 1.52e+170) (+ 1.0 (* (* x x) 0.5)) (* y (* y -0.16666666666666666))))
double code(double x, double y) {
double tmp;
if (y <= 1.52e+170) {
tmp = 1.0 + ((x * x) * 0.5);
} else {
tmp = y * (y * -0.16666666666666666);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.52d+170) then
tmp = 1.0d0 + ((x * x) * 0.5d0)
else
tmp = y * (y * (-0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.52e+170) {
tmp = 1.0 + ((x * x) * 0.5);
} else {
tmp = y * (y * -0.16666666666666666);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.52e+170: tmp = 1.0 + ((x * x) * 0.5) else: tmp = y * (y * -0.16666666666666666) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.52e+170) tmp = Float64(1.0 + Float64(Float64(x * x) * 0.5)); else tmp = Float64(y * Float64(y * -0.16666666666666666)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.52e+170) tmp = 1.0 + ((x * x) * 0.5); else tmp = y * (y * -0.16666666666666666); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.52e+170], N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.52 \cdot 10^{+170}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(y \cdot -0.16666666666666666\right)\\
\end{array}
\end{array}
if y < 1.51999999999999997e170Initial program 99.9%
Taylor expanded in y around 0
Simplified66.2%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6445.8%
Simplified45.8%
if 1.51999999999999997e170 < y Initial program 99.6%
associate-*r/N/A
frac-2negN/A
neg-sub0N/A
flip--N/A
+-lft-identityN/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr3.5%
Taylor expanded in x around 0
Simplified4.2%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f640.0%
Simplified0.0%
Taylor expanded in y around inf
*-commutativeN/A
*-lowering-*.f6430.2%
Simplified30.2%
Final simplification43.8%
(FPCore (x y) :precision binary64 (if (<= y 2.3e+82) 1.0 (* y (* y -0.16666666666666666))))
double code(double x, double y) {
double tmp;
if (y <= 2.3e+82) {
tmp = 1.0;
} else {
tmp = y * (y * -0.16666666666666666);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.3d+82) then
tmp = 1.0d0
else
tmp = y * (y * (-0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.3e+82) {
tmp = 1.0;
} else {
tmp = y * (y * -0.16666666666666666);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.3e+82: tmp = 1.0 else: tmp = y * (y * -0.16666666666666666) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.3e+82) tmp = 1.0; else tmp = Float64(y * Float64(y * -0.16666666666666666)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.3e+82) tmp = 1.0; else tmp = y * (y * -0.16666666666666666); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.3e+82], 1.0, N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{+82}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(y \cdot -0.16666666666666666\right)\\
\end{array}
\end{array}
if y < 2.29999999999999988e82Initial program 99.9%
Taylor expanded in y around 0
Simplified71.0%
Taylor expanded in x around 0
Simplified30.6%
if 2.29999999999999988e82 < y Initial program 99.8%
associate-*r/N/A
frac-2negN/A
neg-sub0N/A
flip--N/A
+-lft-identityN/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr36.5%
Taylor expanded in x around 0
Simplified18.5%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f649.2%
Simplified9.2%
Taylor expanded in y around inf
*-commutativeN/A
*-lowering-*.f6418.9%
Simplified18.9%
Final simplification28.0%
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
return 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.9%
Taylor expanded in y around 0
Simplified60.0%
Taylor expanded in x around 0
Simplified24.2%
(FPCore (x y) :precision binary64 (/ (* (cosh x) (sin y)) y))
double code(double x, double y) {
return (cosh(x) * sin(y)) / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (cosh(x) * sin(y)) / y
end function
public static double code(double x, double y) {
return (Math.cosh(x) * Math.sin(y)) / y;
}
def code(x, y): return (math.cosh(x) * math.sin(y)) / y
function code(x, y) return Float64(Float64(cosh(x) * sin(y)) / y) end
function tmp = code(x, y) tmp = (cosh(x) * sin(y)) / y; end
code[x_, y_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cosh x \cdot \sin y}{y}
\end{array}
herbie shell --seed 2024150
(FPCore (x y)
:name "Linear.Quaternion:$csinh from linear-1.19.1.3"
:precision binary64
:alt
(! :herbie-platform default (/ (* (cosh x) (sin y)) y))
(* (cosh x) (/ (sin y) y)))