
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) y)))
double code(double x, double y) {
return sin(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / y)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) y)))
double code(double x, double y) {
return sin(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / y)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{y}
\end{array}
(FPCore (x y) :precision binary64 (/ (sin x) (/ y (sinh y))))
double code(double x, double y) {
return sin(x) / (y / sinh(y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) / (y / sinh(y))
end function
public static double code(double x, double y) {
return Math.sin(x) / (y / Math.sinh(y));
}
def code(x, y): return math.sin(x) / (y / math.sinh(y))
function code(x, y) return Float64(sin(x) / Float64(y / sinh(y))) end
function tmp = code(x, y) tmp = sin(x) / (y / sinh(y)); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] / N[(y / N[Sinh[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x}{\frac{y}{\sinh y}}
\end{array}
Initial program 100.0%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) y)))
double code(double x, double y) {
return sin(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / y)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{y}
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* (sin x) (* y y))))
(t_1
(*
x
(+
-1.0
(/
(- 1.0 (* (pow y 4.0) 0.027777777777777776))
(+ 1.0 (* y (* y -0.16666666666666666))))))))
(if (<= y -1.35e+154)
t_0
(if (<= y -1e+40)
t_1
(if (<= y 2.2e+66)
(* (sin x) (+ 1.0 (* 0.16666666666666666 (* y y))))
(if (<= y 2.25e+150) (+ x t_1) t_0))))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (sin(x) * (y * y));
double t_1 = x * (-1.0 + ((1.0 - (pow(y, 4.0) * 0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666)))));
double tmp;
if (y <= -1.35e+154) {
tmp = t_0;
} else if (y <= -1e+40) {
tmp = t_1;
} else if (y <= 2.2e+66) {
tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 2.25e+150) {
tmp = x + t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = 0.16666666666666666d0 * (sin(x) * (y * y))
t_1 = x * ((-1.0d0) + ((1.0d0 - ((y ** 4.0d0) * 0.027777777777777776d0)) / (1.0d0 + (y * (y * (-0.16666666666666666d0))))))
if (y <= (-1.35d+154)) then
tmp = t_0
else if (y <= (-1d+40)) then
tmp = t_1
else if (y <= 2.2d+66) then
tmp = sin(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
else if (y <= 2.25d+150) then
tmp = x + t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.16666666666666666 * (Math.sin(x) * (y * y));
double t_1 = x * (-1.0 + ((1.0 - (Math.pow(y, 4.0) * 0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666)))));
double tmp;
if (y <= -1.35e+154) {
tmp = t_0;
} else if (y <= -1e+40) {
tmp = t_1;
} else if (y <= 2.2e+66) {
tmp = Math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 2.25e+150) {
tmp = x + t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (math.sin(x) * (y * y)) t_1 = x * (-1.0 + ((1.0 - (math.pow(y, 4.0) * 0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666))))) tmp = 0 if y <= -1.35e+154: tmp = t_0 elif y <= -1e+40: tmp = t_1 elif y <= 2.2e+66: tmp = math.sin(x) * (1.0 + (0.16666666666666666 * (y * y))) elif y <= 2.25e+150: tmp = x + t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(sin(x) * Float64(y * y))) t_1 = Float64(x * Float64(-1.0 + Float64(Float64(1.0 - Float64((y ^ 4.0) * 0.027777777777777776)) / Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666)))))) tmp = 0.0 if (y <= -1.35e+154) tmp = t_0; elseif (y <= -1e+40) tmp = t_1; elseif (y <= 2.2e+66) tmp = Float64(sin(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); elseif (y <= 2.25e+150) tmp = Float64(x + t_1); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (sin(x) * (y * y)); t_1 = x * (-1.0 + ((1.0 - ((y ^ 4.0) * 0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666))))); tmp = 0.0; if (y <= -1.35e+154) tmp = t_0; elseif (y <= -1e+40) tmp = t_1; elseif (y <= 2.2e+66) tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y))); elseif (y <= 2.25e+150) tmp = x + t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Sin[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(-1.0 + N[(N[(1.0 - N[(N[Power[y, 4.0], $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.35e+154], t$95$0, If[LessEqual[y, -1e+40], t$95$1, If[LessEqual[y, 2.2e+66], N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.25e+150], N[(x + t$95$1), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\
t_1 := x \cdot \left(-1 + \frac{1 - {y}^{4} \cdot 0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}\right)\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1 \cdot 10^{+40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+66}:\\
\;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{+150}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.35000000000000003e154 or 2.25e150 < y Initial program 100.0%
Taylor expanded in y around 0 98.5%
unpow298.5%
Simplified98.5%
Taylor expanded in y around inf 98.5%
unpow298.5%
*-commutative98.5%
Simplified98.5%
if -1.35000000000000003e154 < y < -1.00000000000000003e40Initial program 100.0%
Taylor expanded in y around 0 5.0%
unpow25.0%
Simplified5.0%
Taylor expanded in x around 0 17.5%
*-commutative17.5%
+-commutative17.5%
unpow217.5%
fma-udef17.5%
Simplified17.5%
Taylor expanded in y around inf 17.5%
unpow217.5%
Simplified17.5%
expm1-log1p-u17.5%
expm1-udef17.5%
log1p-udef17.5%
add-exp-log17.5%
flip-+54.6%
div-inv54.6%
fma-neg54.6%
metadata-eval54.6%
swap-sqr54.6%
metadata-eval54.6%
pow254.6%
pow254.6%
pow-prod-up54.6%
metadata-eval54.6%
metadata-eval54.6%
Applied egg-rr54.6%
fma-udef54.6%
+-commutative54.6%
associate-*r/54.6%
*-rgt-identity54.6%
*-commutative54.6%
cancel-sign-sub-inv54.6%
metadata-eval54.6%
*-commutative54.6%
associate-*l*54.6%
Simplified54.6%
if -1.00000000000000003e40 < y < 2.1999999999999998e66Initial program 100.0%
Taylor expanded in y around 0 87.7%
unpow287.7%
Simplified87.7%
if 2.1999999999999998e66 < y < 2.25e150Initial program 100.0%
Taylor expanded in y around 0 4.7%
unpow24.7%
Simplified4.7%
Taylor expanded in x around 0 9.5%
*-commutative9.5%
+-commutative9.5%
unpow29.5%
fma-udef9.5%
Simplified9.5%
fma-udef9.5%
distribute-rgt-in9.5%
*-un-lft-identity9.5%
Applied egg-rr9.5%
expm1-log1p-u9.5%
expm1-udef9.5%
log1p-udef9.5%
add-exp-log9.5%
flip-+65.4%
div-inv65.4%
fma-neg65.4%
metadata-eval65.4%
swap-sqr65.4%
metadata-eval65.4%
pow265.4%
pow265.4%
pow-prod-up65.4%
metadata-eval65.4%
metadata-eval65.4%
Applied egg-rr65.4%
fma-udef65.4%
+-commutative65.4%
associate-*r/65.4%
*-rgt-identity65.4%
*-commutative65.4%
cancel-sign-sub-inv65.4%
metadata-eval65.4%
*-commutative65.4%
associate-*l*65.4%
Simplified65.4%
Final simplification85.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* (sin x) (* y y))))
(t_1 (* y (* y -0.16666666666666666))))
(if (<= y -1.35e+154)
t_0
(if (<= y -1.35e+40)
(*
x
(+ -1.0 (/ (- 1.0 (* (pow y 4.0) 0.027777777777777776)) (+ 1.0 t_1))))
(if (<= y 2.7e+22)
(* (sin x) (+ 1.0 (* 0.16666666666666666 (* y y))))
(if (<= y 2.25e+150)
(/
(* x (- x (* (pow y 4.0) (* x 0.027777777777777776))))
(+ x (* x t_1)))
t_0))))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (sin(x) * (y * y));
double t_1 = y * (y * -0.16666666666666666);
double tmp;
if (y <= -1.35e+154) {
tmp = t_0;
} else if (y <= -1.35e+40) {
tmp = x * (-1.0 + ((1.0 - (pow(y, 4.0) * 0.027777777777777776)) / (1.0 + t_1)));
} else if (y <= 2.7e+22) {
tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 2.25e+150) {
tmp = (x * (x - (pow(y, 4.0) * (x * 0.027777777777777776)))) / (x + (x * t_1));
} 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) :: t_1
real(8) :: tmp
t_0 = 0.16666666666666666d0 * (sin(x) * (y * y))
t_1 = y * (y * (-0.16666666666666666d0))
if (y <= (-1.35d+154)) then
tmp = t_0
else if (y <= (-1.35d+40)) then
tmp = x * ((-1.0d0) + ((1.0d0 - ((y ** 4.0d0) * 0.027777777777777776d0)) / (1.0d0 + t_1)))
else if (y <= 2.7d+22) then
tmp = sin(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
else if (y <= 2.25d+150) then
tmp = (x * (x - ((y ** 4.0d0) * (x * 0.027777777777777776d0)))) / (x + (x * t_1))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.16666666666666666 * (Math.sin(x) * (y * y));
double t_1 = y * (y * -0.16666666666666666);
double tmp;
if (y <= -1.35e+154) {
tmp = t_0;
} else if (y <= -1.35e+40) {
tmp = x * (-1.0 + ((1.0 - (Math.pow(y, 4.0) * 0.027777777777777776)) / (1.0 + t_1)));
} else if (y <= 2.7e+22) {
tmp = Math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 2.25e+150) {
tmp = (x * (x - (Math.pow(y, 4.0) * (x * 0.027777777777777776)))) / (x + (x * t_1));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (math.sin(x) * (y * y)) t_1 = y * (y * -0.16666666666666666) tmp = 0 if y <= -1.35e+154: tmp = t_0 elif y <= -1.35e+40: tmp = x * (-1.0 + ((1.0 - (math.pow(y, 4.0) * 0.027777777777777776)) / (1.0 + t_1))) elif y <= 2.7e+22: tmp = math.sin(x) * (1.0 + (0.16666666666666666 * (y * y))) elif y <= 2.25e+150: tmp = (x * (x - (math.pow(y, 4.0) * (x * 0.027777777777777776)))) / (x + (x * t_1)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(sin(x) * Float64(y * y))) t_1 = Float64(y * Float64(y * -0.16666666666666666)) tmp = 0.0 if (y <= -1.35e+154) tmp = t_0; elseif (y <= -1.35e+40) tmp = Float64(x * Float64(-1.0 + Float64(Float64(1.0 - Float64((y ^ 4.0) * 0.027777777777777776)) / Float64(1.0 + t_1)))); elseif (y <= 2.7e+22) tmp = Float64(sin(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); elseif (y <= 2.25e+150) tmp = Float64(Float64(x * Float64(x - Float64((y ^ 4.0) * Float64(x * 0.027777777777777776)))) / Float64(x + Float64(x * t_1))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (sin(x) * (y * y)); t_1 = y * (y * -0.16666666666666666); tmp = 0.0; if (y <= -1.35e+154) tmp = t_0; elseif (y <= -1.35e+40) tmp = x * (-1.0 + ((1.0 - ((y ^ 4.0) * 0.027777777777777776)) / (1.0 + t_1))); elseif (y <= 2.7e+22) tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y))); elseif (y <= 2.25e+150) tmp = (x * (x - ((y ^ 4.0) * (x * 0.027777777777777776)))) / (x + (x * t_1)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Sin[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.35e+154], t$95$0, If[LessEqual[y, -1.35e+40], N[(x * N[(-1.0 + N[(N[(1.0 - N[(N[Power[y, 4.0], $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision] / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e+22], N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.25e+150], N[(N[(x * N[(x - N[(N[Power[y, 4.0], $MachinePrecision] * N[(x * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\
t_1 := y \cdot \left(y \cdot -0.16666666666666666\right)\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{+40}:\\
\;\;\;\;x \cdot \left(-1 + \frac{1 - {y}^{4} \cdot 0.027777777777777776}{1 + t_1}\right)\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+22}:\\
\;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{+150}:\\
\;\;\;\;\frac{x \cdot \left(x - {y}^{4} \cdot \left(x \cdot 0.027777777777777776\right)\right)}{x + x \cdot t_1}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.35000000000000003e154 or 2.25e150 < y Initial program 100.0%
Taylor expanded in y around 0 98.5%
unpow298.5%
Simplified98.5%
Taylor expanded in y around inf 98.5%
unpow298.5%
*-commutative98.5%
Simplified98.5%
if -1.35000000000000003e154 < y < -1.35000000000000005e40Initial program 100.0%
Taylor expanded in y around 0 5.0%
unpow25.0%
Simplified5.0%
Taylor expanded in x around 0 17.5%
*-commutative17.5%
+-commutative17.5%
unpow217.5%
fma-udef17.5%
Simplified17.5%
Taylor expanded in y around inf 17.5%
unpow217.5%
Simplified17.5%
expm1-log1p-u17.5%
expm1-udef17.5%
log1p-udef17.5%
add-exp-log17.5%
flip-+54.6%
div-inv54.6%
fma-neg54.6%
metadata-eval54.6%
swap-sqr54.6%
metadata-eval54.6%
pow254.6%
pow254.6%
pow-prod-up54.6%
metadata-eval54.6%
metadata-eval54.6%
Applied egg-rr54.6%
fma-udef54.6%
+-commutative54.6%
associate-*r/54.6%
*-rgt-identity54.6%
*-commutative54.6%
cancel-sign-sub-inv54.6%
metadata-eval54.6%
*-commutative54.6%
associate-*l*54.6%
Simplified54.6%
if -1.35000000000000005e40 < y < 2.7000000000000002e22Initial program 100.0%
Taylor expanded in y around 0 91.7%
unpow291.7%
Simplified91.7%
if 2.7000000000000002e22 < y < 2.25e150Initial program 100.0%
Taylor expanded in y around 0 4.3%
unpow24.3%
Simplified4.3%
Taylor expanded in x around 0 7.4%
*-commutative7.4%
+-commutative7.4%
unpow27.4%
fma-udef7.4%
Simplified7.4%
fma-udef7.4%
distribute-rgt-in7.4%
*-un-lft-identity7.4%
Applied egg-rr7.4%
+-commutative7.4%
flip-+14.4%
swap-sqr33.9%
swap-sqr33.9%
metadata-eval33.9%
pow233.9%
pow233.9%
pow-prod-up33.9%
metadata-eval33.9%
associate-*l*33.9%
associate-*r*33.9%
Applied egg-rr33.9%
associate-*r*46.5%
distribute-rgt-out--50.6%
*-commutative50.6%
associate-*l*50.6%
*-commutative50.6%
associate-*r*50.6%
associate-*r*50.6%
cancel-sign-sub-inv50.6%
distribute-lft-neg-in50.6%
metadata-eval50.6%
*-commutative50.6%
associate-*l*50.6%
Simplified50.6%
Final simplification85.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* (sin x) (* y y))))
(t_1
(*
x
(+
-1.0
(/
(- 1.0 (* (pow y 4.0) 0.027777777777777776))
(+ 1.0 (* y (* y -0.16666666666666666))))))))
(if (<= y -1.35e+154)
t_0
(if (<= y -1.1e+40)
t_1
(if (<= y 1.25e+69)
(* (sin x) (+ 1.0 (* 0.16666666666666666 (* y y))))
(if (<= y 2.25e+150) t_1 t_0))))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (sin(x) * (y * y));
double t_1 = x * (-1.0 + ((1.0 - (pow(y, 4.0) * 0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666)))));
double tmp;
if (y <= -1.35e+154) {
tmp = t_0;
} else if (y <= -1.1e+40) {
tmp = t_1;
} else if (y <= 1.25e+69) {
tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 2.25e+150) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = 0.16666666666666666d0 * (sin(x) * (y * y))
t_1 = x * ((-1.0d0) + ((1.0d0 - ((y ** 4.0d0) * 0.027777777777777776d0)) / (1.0d0 + (y * (y * (-0.16666666666666666d0))))))
if (y <= (-1.35d+154)) then
tmp = t_0
else if (y <= (-1.1d+40)) then
tmp = t_1
else if (y <= 1.25d+69) then
tmp = sin(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
else if (y <= 2.25d+150) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.16666666666666666 * (Math.sin(x) * (y * y));
double t_1 = x * (-1.0 + ((1.0 - (Math.pow(y, 4.0) * 0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666)))));
double tmp;
if (y <= -1.35e+154) {
tmp = t_0;
} else if (y <= -1.1e+40) {
tmp = t_1;
} else if (y <= 1.25e+69) {
tmp = Math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 2.25e+150) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (math.sin(x) * (y * y)) t_1 = x * (-1.0 + ((1.0 - (math.pow(y, 4.0) * 0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666))))) tmp = 0 if y <= -1.35e+154: tmp = t_0 elif y <= -1.1e+40: tmp = t_1 elif y <= 1.25e+69: tmp = math.sin(x) * (1.0 + (0.16666666666666666 * (y * y))) elif y <= 2.25e+150: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(sin(x) * Float64(y * y))) t_1 = Float64(x * Float64(-1.0 + Float64(Float64(1.0 - Float64((y ^ 4.0) * 0.027777777777777776)) / Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666)))))) tmp = 0.0 if (y <= -1.35e+154) tmp = t_0; elseif (y <= -1.1e+40) tmp = t_1; elseif (y <= 1.25e+69) tmp = Float64(sin(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); elseif (y <= 2.25e+150) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (sin(x) * (y * y)); t_1 = x * (-1.0 + ((1.0 - ((y ^ 4.0) * 0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666))))); tmp = 0.0; if (y <= -1.35e+154) tmp = t_0; elseif (y <= -1.1e+40) tmp = t_1; elseif (y <= 1.25e+69) tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y))); elseif (y <= 2.25e+150) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Sin[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(-1.0 + N[(N[(1.0 - N[(N[Power[y, 4.0], $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.35e+154], t$95$0, If[LessEqual[y, -1.1e+40], t$95$1, If[LessEqual[y, 1.25e+69], N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.25e+150], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\
t_1 := x \cdot \left(-1 + \frac{1 - {y}^{4} \cdot 0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}\right)\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{+40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+69}:\\
\;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{+150}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.35000000000000003e154 or 2.25e150 < y Initial program 100.0%
Taylor expanded in y around 0 98.5%
unpow298.5%
Simplified98.5%
Taylor expanded in y around inf 98.5%
unpow298.5%
*-commutative98.5%
Simplified98.5%
if -1.35000000000000003e154 < y < -1.0999999999999999e40 or 1.25000000000000009e69 < y < 2.25e150Initial program 100.0%
Taylor expanded in y around 0 4.9%
unpow24.9%
Simplified4.9%
Taylor expanded in x around 0 14.6%
*-commutative14.6%
+-commutative14.6%
unpow214.6%
fma-udef14.6%
Simplified14.6%
Taylor expanded in y around inf 14.6%
unpow214.6%
Simplified14.6%
expm1-log1p-u14.6%
expm1-udef14.6%
log1p-udef14.6%
add-exp-log14.6%
flip-+60.2%
div-inv60.2%
fma-neg60.2%
metadata-eval60.2%
swap-sqr60.2%
metadata-eval60.2%
pow260.2%
pow260.2%
pow-prod-up60.2%
metadata-eval60.2%
metadata-eval60.2%
Applied egg-rr60.2%
fma-udef60.2%
+-commutative60.2%
associate-*r/60.2%
*-rgt-identity60.2%
*-commutative60.2%
cancel-sign-sub-inv60.2%
metadata-eval60.2%
*-commutative60.2%
associate-*l*60.2%
Simplified60.2%
if -1.0999999999999999e40 < y < 1.25000000000000009e69Initial program 100.0%
Taylor expanded in y around 0 87.2%
unpow287.2%
Simplified87.2%
Final simplification85.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* (sin x) (* y y))))
(t_1 (* y (* y (* -0.027777777777777776 (pow x 3.0))))))
(if (<= y -1.25e+152)
t_0
(if (<= y -10500.0)
t_1
(if (<= y 1.7e+47) (sin x) (if (<= y 1.32e+154) t_1 t_0))))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (sin(x) * (y * y));
double t_1 = y * (y * (-0.027777777777777776 * pow(x, 3.0)));
double tmp;
if (y <= -1.25e+152) {
tmp = t_0;
} else if (y <= -10500.0) {
tmp = t_1;
} else if (y <= 1.7e+47) {
tmp = sin(x);
} else if (y <= 1.32e+154) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = 0.16666666666666666d0 * (sin(x) * (y * y))
t_1 = y * (y * ((-0.027777777777777776d0) * (x ** 3.0d0)))
if (y <= (-1.25d+152)) then
tmp = t_0
else if (y <= (-10500.0d0)) then
tmp = t_1
else if (y <= 1.7d+47) then
tmp = sin(x)
else if (y <= 1.32d+154) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.16666666666666666 * (Math.sin(x) * (y * y));
double t_1 = y * (y * (-0.027777777777777776 * Math.pow(x, 3.0)));
double tmp;
if (y <= -1.25e+152) {
tmp = t_0;
} else if (y <= -10500.0) {
tmp = t_1;
} else if (y <= 1.7e+47) {
tmp = Math.sin(x);
} else if (y <= 1.32e+154) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (math.sin(x) * (y * y)) t_1 = y * (y * (-0.027777777777777776 * math.pow(x, 3.0))) tmp = 0 if y <= -1.25e+152: tmp = t_0 elif y <= -10500.0: tmp = t_1 elif y <= 1.7e+47: tmp = math.sin(x) elif y <= 1.32e+154: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(sin(x) * Float64(y * y))) t_1 = Float64(y * Float64(y * Float64(-0.027777777777777776 * (x ^ 3.0)))) tmp = 0.0 if (y <= -1.25e+152) tmp = t_0; elseif (y <= -10500.0) tmp = t_1; elseif (y <= 1.7e+47) tmp = sin(x); elseif (y <= 1.32e+154) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (sin(x) * (y * y)); t_1 = y * (y * (-0.027777777777777776 * (x ^ 3.0))); tmp = 0.0; if (y <= -1.25e+152) tmp = t_0; elseif (y <= -10500.0) tmp = t_1; elseif (y <= 1.7e+47) tmp = sin(x); elseif (y <= 1.32e+154) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Sin[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(y * N[(-0.027777777777777776 * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.25e+152], t$95$0, If[LessEqual[y, -10500.0], t$95$1, If[LessEqual[y, 1.7e+47], N[Sin[x], $MachinePrecision], If[LessEqual[y, 1.32e+154], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\
t_1 := y \cdot \left(y \cdot \left(-0.027777777777777776 \cdot {x}^{3}\right)\right)\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{+152}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -10500:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+47}:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.25e152 or 1.31999999999999998e154 < y Initial program 100.0%
Taylor expanded in y around 0 95.2%
unpow295.2%
Simplified95.2%
Taylor expanded in y around inf 95.2%
unpow295.2%
*-commutative95.2%
Simplified95.2%
if -1.25e152 < y < -10500 or 1.6999999999999999e47 < y < 1.31999999999999998e154Initial program 100.0%
Taylor expanded in y around 0 4.8%
unpow24.8%
Simplified4.8%
Taylor expanded in y around inf 4.8%
unpow24.8%
associate-*l*4.8%
Simplified4.8%
Taylor expanded in x around 0 7.5%
*-commutative7.5%
associate-*l*7.5%
*-commutative7.5%
associate-*l*7.5%
distribute-lft-out35.5%
unpow235.5%
*-commutative35.5%
Simplified35.5%
Taylor expanded in x around inf 34.6%
*-commutative34.6%
unpow234.6%
associate-*r*34.6%
associate-*l*34.6%
*-commutative34.6%
Simplified34.6%
if -10500 < y < 1.6999999999999999e47Initial program 100.0%
Taylor expanded in y around 0 92.6%
Final simplification81.9%
(FPCore (x y) :precision binary64 (if (or (<= y -2.5) (not (<= y 2.45))) (* 0.16666666666666666 (* (sin x) (* y y))) (sin x)))
double code(double x, double y) {
double tmp;
if ((y <= -2.5) || !(y <= 2.45)) {
tmp = 0.16666666666666666 * (sin(x) * (y * y));
} else {
tmp = sin(x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-2.5d0)) .or. (.not. (y <= 2.45d0))) then
tmp = 0.16666666666666666d0 * (sin(x) * (y * y))
else
tmp = sin(x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -2.5) || !(y <= 2.45)) {
tmp = 0.16666666666666666 * (Math.sin(x) * (y * y));
} else {
tmp = Math.sin(x);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -2.5) or not (y <= 2.45): tmp = 0.16666666666666666 * (math.sin(x) * (y * y)) else: tmp = math.sin(x) return tmp
function code(x, y) tmp = 0.0 if ((y <= -2.5) || !(y <= 2.45)) tmp = Float64(0.16666666666666666 * Float64(sin(x) * Float64(y * y))); else tmp = sin(x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -2.5) || ~((y <= 2.45))) tmp = 0.16666666666666666 * (sin(x) * (y * y)); else tmp = sin(x); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -2.5], N[Not[LessEqual[y, 2.45]], $MachinePrecision]], N[(0.16666666666666666 * N[(N[Sin[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[x], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \lor \neg \left(y \leq 2.45\right):\\
\;\;\;\;0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin x\\
\end{array}
\end{array}
if y < -2.5 or 2.4500000000000002 < y Initial program 100.0%
Taylor expanded in y around 0 49.9%
unpow249.9%
Simplified49.9%
Taylor expanded in y around inf 49.9%
unpow249.9%
*-commutative49.9%
Simplified49.9%
if -2.5 < y < 2.4500000000000002Initial program 100.0%
Taylor expanded in y around 0 99.1%
Final simplification76.1%
(FPCore (x y) :precision binary64 (if (<= y -9e-6) (* x (+ 1.0 (* 0.16666666666666666 (* y y)))) (if (<= y 2.45) (sin x) (* 0.16666666666666666 (* y (* (sin x) y))))))
double code(double x, double y) {
double tmp;
if (y <= -9e-6) {
tmp = x * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 2.45) {
tmp = sin(x);
} else {
tmp = 0.16666666666666666 * (y * (sin(x) * y));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-9d-6)) then
tmp = x * (1.0d0 + (0.16666666666666666d0 * (y * y)))
else if (y <= 2.45d0) then
tmp = sin(x)
else
tmp = 0.16666666666666666d0 * (y * (sin(x) * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -9e-6) {
tmp = x * (1.0 + (0.16666666666666666 * (y * y)));
} else if (y <= 2.45) {
tmp = Math.sin(x);
} else {
tmp = 0.16666666666666666 * (y * (Math.sin(x) * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -9e-6: tmp = x * (1.0 + (0.16666666666666666 * (y * y))) elif y <= 2.45: tmp = math.sin(x) else: tmp = 0.16666666666666666 * (y * (math.sin(x) * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= -9e-6) tmp = Float64(x * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); elseif (y <= 2.45) tmp = sin(x); else tmp = Float64(0.16666666666666666 * Float64(y * Float64(sin(x) * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -9e-6) tmp = x * (1.0 + (0.16666666666666666 * (y * y))); elseif (y <= 2.45) tmp = sin(x); else tmp = 0.16666666666666666 * (y * (sin(x) * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -9e-6], N[(x * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45], N[Sin[x], $MachinePrecision], N[(0.16666666666666666 * N[(y * N[(N[Sin[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 2.45:\\
\;\;\;\;\sin x\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(\sin x \cdot y\right)\right)\\
\end{array}
\end{array}
if y < -9.00000000000000023e-6Initial program 100.0%
Taylor expanded in y around 0 48.0%
unpow248.0%
Simplified48.0%
Taylor expanded in x around 0 45.1%
*-commutative45.1%
+-commutative45.1%
unpow245.1%
fma-udef45.1%
Simplified45.1%
fma-udef45.1%
Applied egg-rr45.1%
if -9.00000000000000023e-6 < y < 2.4500000000000002Initial program 100.0%
Taylor expanded in y around 0 99.9%
if 2.4500000000000002 < y Initial program 100.0%
Taylor expanded in y around 0 52.4%
unpow252.4%
Simplified52.4%
Taylor expanded in y around inf 52.4%
unpow252.4%
associate-*l*50.8%
Simplified50.8%
Final simplification75.1%
(FPCore (x y) :precision binary64 (* (sin x) (+ 1.0 (* 0.16666666666666666 (* y y)))))
double code(double x, double y) {
return sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
end function
public static double code(double x, double y) {
return Math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
}
def code(x, y): return math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)))
function code(x, y) return Float64(sin(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))) end
function tmp = code(x, y) tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y))); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0 76.2%
unpow276.2%
Simplified76.2%
Final simplification76.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* y y))))
(if (<= y -9e-6)
(* x (+ 1.0 t_0))
(if (<= y 5.6e-24) (sin x) (+ x (* x t_0))))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double tmp;
if (y <= -9e-6) {
tmp = x * (1.0 + t_0);
} else if (y <= 5.6e-24) {
tmp = sin(x);
} else {
tmp = x + (x * 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 = 0.16666666666666666d0 * (y * y)
if (y <= (-9d-6)) then
tmp = x * (1.0d0 + t_0)
else if (y <= 5.6d-24) then
tmp = sin(x)
else
tmp = x + (x * t_0)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double tmp;
if (y <= -9e-6) {
tmp = x * (1.0 + t_0);
} else if (y <= 5.6e-24) {
tmp = Math.sin(x);
} else {
tmp = x + (x * t_0);
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (y * y) tmp = 0 if y <= -9e-6: tmp = x * (1.0 + t_0) elif y <= 5.6e-24: tmp = math.sin(x) else: tmp = x + (x * t_0) return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(y * y)) tmp = 0.0 if (y <= -9e-6) tmp = Float64(x * Float64(1.0 + t_0)); elseif (y <= 5.6e-24) tmp = sin(x); else tmp = Float64(x + Float64(x * t_0)); end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (y * y); tmp = 0.0; if (y <= -9e-6) tmp = x * (1.0 + t_0); elseif (y <= 5.6e-24) tmp = sin(x); else tmp = x + (x * t_0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9e-6], N[(x * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.6e-24], N[Sin[x], $MachinePrecision], N[(x + N[(x * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq -9 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \left(1 + t_0\right)\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{-24}:\\
\;\;\;\;\sin x\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot t_0\\
\end{array}
\end{array}
if y < -9.00000000000000023e-6Initial program 100.0%
Taylor expanded in y around 0 48.0%
unpow248.0%
Simplified48.0%
Taylor expanded in x around 0 45.1%
*-commutative45.1%
+-commutative45.1%
unpow245.1%
fma-udef45.1%
Simplified45.1%
fma-udef45.1%
Applied egg-rr45.1%
if -9.00000000000000023e-6 < y < 5.6000000000000003e-24Initial program 100.0%
Taylor expanded in y around 0 100.0%
if 5.6000000000000003e-24 < y Initial program 100.0%
Taylor expanded in y around 0 54.6%
unpow254.6%
Simplified54.6%
Taylor expanded in x around 0 39.7%
*-commutative39.7%
+-commutative39.7%
unpow239.7%
fma-udef39.7%
Simplified39.7%
fma-udef39.7%
distribute-rgt-in39.7%
*-un-lft-identity39.7%
Applied egg-rr39.7%
Final simplification71.9%
(FPCore (x y) :precision binary64 (if (or (<= y -9e+16) (not (<= y 2.45))) (* 0.16666666666666666 (* y (* x y))) x))
double code(double x, double y) {
double tmp;
if ((y <= -9e+16) || !(y <= 2.45)) {
tmp = 0.16666666666666666 * (y * (x * y));
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-9d+16)) .or. (.not. (y <= 2.45d0))) then
tmp = 0.16666666666666666d0 * (y * (x * y))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -9e+16) || !(y <= 2.45)) {
tmp = 0.16666666666666666 * (y * (x * y));
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -9e+16) or not (y <= 2.45): tmp = 0.16666666666666666 * (y * (x * y)) else: tmp = x return tmp
function code(x, y) tmp = 0.0 if ((y <= -9e+16) || !(y <= 2.45)) tmp = Float64(0.16666666666666666 * Float64(y * Float64(x * y))); else tmp = x; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -9e+16) || ~((y <= 2.45))) tmp = 0.16666666666666666 * (y * (x * y)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -9e+16], N[Not[LessEqual[y, 2.45]], $MachinePrecision]], N[(0.16666666666666666 * N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+16} \lor \neg \left(y \leq 2.45\right):\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -9e16 or 2.4500000000000002 < y Initial program 100.0%
Taylor expanded in y around 0 50.7%
unpow250.7%
Simplified50.7%
Taylor expanded in y around inf 50.7%
unpow250.7%
associate-*l*42.9%
Simplified42.9%
Taylor expanded in x around 0 41.2%
unpow241.2%
associate-*l*33.4%
Simplified33.4%
if -9e16 < y < 2.4500000000000002Initial program 100.0%
Taylor expanded in y around 0 98.1%
unpow298.1%
Simplified98.1%
Taylor expanded in x around 0 55.2%
*-commutative55.2%
+-commutative55.2%
unpow255.2%
fma-udef55.2%
Simplified55.2%
Taylor expanded in y around 0 54.9%
Final simplification45.0%
(FPCore (x y) :precision binary64 (if (or (<= y -9e+16) (not (<= y 2.45))) (* 0.16666666666666666 (* x (* y y))) x))
double code(double x, double y) {
double tmp;
if ((y <= -9e+16) || !(y <= 2.45)) {
tmp = 0.16666666666666666 * (x * (y * y));
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-9d+16)) .or. (.not. (y <= 2.45d0))) then
tmp = 0.16666666666666666d0 * (x * (y * y))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -9e+16) || !(y <= 2.45)) {
tmp = 0.16666666666666666 * (x * (y * y));
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -9e+16) or not (y <= 2.45): tmp = 0.16666666666666666 * (x * (y * y)) else: tmp = x return tmp
function code(x, y) tmp = 0.0 if ((y <= -9e+16) || !(y <= 2.45)) tmp = Float64(0.16666666666666666 * Float64(x * Float64(y * y))); else tmp = x; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -9e+16) || ~((y <= 2.45))) tmp = 0.16666666666666666 * (x * (y * y)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -9e+16], N[Not[LessEqual[y, 2.45]], $MachinePrecision]], N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+16} \lor \neg \left(y \leq 2.45\right):\\
\;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -9e16 or 2.4500000000000002 < y Initial program 100.0%
Taylor expanded in y around 0 50.7%
unpow250.7%
Simplified50.7%
Taylor expanded in y around inf 50.7%
unpow250.7%
associate-*l*42.9%
Simplified42.9%
Taylor expanded in x around 0 41.2%
unpow241.2%
Simplified41.2%
if -9e16 < y < 2.4500000000000002Initial program 100.0%
Taylor expanded in y around 0 98.1%
unpow298.1%
Simplified98.1%
Taylor expanded in x around 0 55.2%
*-commutative55.2%
+-commutative55.2%
unpow255.2%
fma-udef55.2%
Simplified55.2%
Taylor expanded in y around 0 54.9%
Final simplification48.6%
(FPCore (x y) :precision binary64 (* x (+ 1.0 (* 0.16666666666666666 (* y y)))))
double code(double x, double y) {
return x * (1.0 + (0.16666666666666666 * (y * y)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (1.0d0 + (0.16666666666666666d0 * (y * y)))
end function
public static double code(double x, double y) {
return x * (1.0 + (0.16666666666666666 * (y * y)));
}
def code(x, y): return x * (1.0 + (0.16666666666666666 * (y * y)))
function code(x, y) return Float64(x * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))) end
function tmp = code(x, y) tmp = x * (1.0 + (0.16666666666666666 * (y * y))); end
code[x_, y_] := N[(x * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0 76.2%
unpow276.2%
Simplified76.2%
Taylor expanded in x around 0 48.8%
*-commutative48.8%
+-commutative48.8%
unpow248.8%
fma-udef48.8%
Simplified48.8%
fma-udef48.8%
Applied egg-rr48.8%
Final simplification48.8%
(FPCore (x y) :precision binary64 (+ x (* x (* 0.16666666666666666 (* y y)))))
double code(double x, double y) {
return x + (x * (0.16666666666666666 * (y * y)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + (x * (0.16666666666666666d0 * (y * y)))
end function
public static double code(double x, double y) {
return x + (x * (0.16666666666666666 * (y * y)));
}
def code(x, y): return x + (x * (0.16666666666666666 * (y * y)))
function code(x, y) return Float64(x + Float64(x * Float64(0.16666666666666666 * Float64(y * y)))) end
function tmp = code(x, y) tmp = x + (x * (0.16666666666666666 * (y * y))); end
code[x_, y_] := N[(x + N[(x * N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0 76.2%
unpow276.2%
Simplified76.2%
Taylor expanded in x around 0 48.8%
*-commutative48.8%
+-commutative48.8%
unpow248.8%
fma-udef48.8%
Simplified48.8%
fma-udef48.8%
distribute-rgt-in48.8%
*-un-lft-identity48.8%
Applied egg-rr48.8%
Final simplification48.8%
(FPCore (x y) :precision binary64 x)
double code(double x, double y) {
return x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x
end function
public static double code(double x, double y) {
return x;
}
def code(x, y): return x
function code(x, y) return x end
function tmp = code(x, y) tmp = x; end
code[x_, y_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 100.0%
Taylor expanded in y around 0 76.2%
unpow276.2%
Simplified76.2%
Taylor expanded in x around 0 48.8%
*-commutative48.8%
+-commutative48.8%
unpow248.8%
fma-udef48.8%
Simplified48.8%
Taylor expanded in y around 0 30.7%
Final simplification30.7%
herbie shell --seed 2023185
(FPCore (x y)
:name "Linear.Quaternion:$ccos from linear-1.19.1.3"
:precision binary64
(* (sin x) (/ (sinh y) y)))