
(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 11 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) (/ (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
(if (<= y -4.5e+146)
(* 0.16666666666666666 (* (sin x) (* y y)))
(if (or (<= y -520.0) (and (not (<= y 30000.0)) (<= y 1.2e+128)))
(*
0.16666666666666666
(* (* y y) (+ x (* (pow x 3.0) -0.16666666666666666))))
(* (sin x) (+ (* 0.16666666666666666 (* y y)) 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= -4.5e+146) {
tmp = 0.16666666666666666 * (sin(x) * (y * y));
} else if ((y <= -520.0) || (!(y <= 30000.0) && (y <= 1.2e+128))) {
tmp = 0.16666666666666666 * ((y * y) * (x + (pow(x, 3.0) * -0.16666666666666666)));
} else {
tmp = sin(x) * ((0.16666666666666666 * (y * y)) + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-4.5d+146)) then
tmp = 0.16666666666666666d0 * (sin(x) * (y * y))
else if ((y <= (-520.0d0)) .or. (.not. (y <= 30000.0d0)) .and. (y <= 1.2d+128)) then
tmp = 0.16666666666666666d0 * ((y * y) * (x + ((x ** 3.0d0) * (-0.16666666666666666d0))))
else
tmp = sin(x) * ((0.16666666666666666d0 * (y * y)) + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -4.5e+146) {
tmp = 0.16666666666666666 * (Math.sin(x) * (y * y));
} else if ((y <= -520.0) || (!(y <= 30000.0) && (y <= 1.2e+128))) {
tmp = 0.16666666666666666 * ((y * y) * (x + (Math.pow(x, 3.0) * -0.16666666666666666)));
} else {
tmp = Math.sin(x) * ((0.16666666666666666 * (y * y)) + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -4.5e+146: tmp = 0.16666666666666666 * (math.sin(x) * (y * y)) elif (y <= -520.0) or (not (y <= 30000.0) and (y <= 1.2e+128)): tmp = 0.16666666666666666 * ((y * y) * (x + (math.pow(x, 3.0) * -0.16666666666666666))) else: tmp = math.sin(x) * ((0.16666666666666666 * (y * y)) + 1.0) return tmp
function code(x, y) tmp = 0.0 if (y <= -4.5e+146) tmp = Float64(0.16666666666666666 * Float64(sin(x) * Float64(y * y))); elseif ((y <= -520.0) || (!(y <= 30000.0) && (y <= 1.2e+128))) tmp = Float64(0.16666666666666666 * Float64(Float64(y * y) * Float64(x + Float64((x ^ 3.0) * -0.16666666666666666)))); else tmp = Float64(sin(x) * Float64(Float64(0.16666666666666666 * Float64(y * y)) + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -4.5e+146) tmp = 0.16666666666666666 * (sin(x) * (y * y)); elseif ((y <= -520.0) || (~((y <= 30000.0)) && (y <= 1.2e+128))) tmp = 0.16666666666666666 * ((y * y) * (x + ((x ^ 3.0) * -0.16666666666666666))); else tmp = sin(x) * ((0.16666666666666666 * (y * y)) + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -4.5e+146], N[(0.16666666666666666 * N[(N[Sin[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -520.0], And[N[Not[LessEqual[y, 30000.0]], $MachinePrecision], LessEqual[y, 1.2e+128]]], N[(0.16666666666666666 * N[(N[(y * y), $MachinePrecision] * N[(x + N[(N[Power[x, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[x], $MachinePrecision] * N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+146}:\\
\;\;\;\;0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;y \leq -520 \lor \neg \left(y \leq 30000\right) \land y \leq 1.2 \cdot 10^{+128}:\\
\;\;\;\;0.16666666666666666 \cdot \left(\left(y \cdot y\right) \cdot \left(x + {x}^{3} \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right) + 1\right)\\
\end{array}
\end{array}
if y < -4.50000000000000026e146Initial program 100.0%
Taylor expanded in y around 0 87.4%
associate-*r*87.4%
distribute-rgt1-in87.4%
unpow287.4%
Simplified87.4%
Taylor expanded in y around 0 87.4%
unpow287.4%
associate-*r*84.7%
*-commutative84.7%
Simplified84.7%
Taylor expanded in y around inf 87.4%
unpow287.4%
*-commutative87.4%
Simplified87.4%
if -4.50000000000000026e146 < y < -520 or 3e4 < y < 1.2000000000000001e128Initial program 100.0%
Taylor expanded in y around 0 4.0%
associate-*r*4.0%
distribute-rgt1-in4.0%
unpow24.0%
Simplified4.0%
Taylor expanded in y around 0 4.0%
unpow24.0%
associate-*r*4.0%
*-commutative4.0%
Simplified4.0%
Taylor expanded in y around inf 4.0%
unpow24.0%
*-commutative4.0%
Simplified4.0%
Taylor expanded in x around 0 18.7%
+-commutative18.7%
*-commutative18.7%
associate-*l*18.7%
distribute-lft-out37.0%
unpow237.0%
Simplified37.0%
if -520 < y < 3e4 or 1.2000000000000001e128 < y Initial program 100.0%
Taylor expanded in y around 0 95.8%
associate-*r*95.8%
distribute-rgt1-in95.8%
unpow295.8%
Simplified95.8%
Final simplification83.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (* x (* y (* y 0.16666666666666666))))))
(if (<= y -0.038)
t_0
(if (<= y 8.2e+29)
(sin x)
(if (<= y 5.6e+224) t_0 (* 0.16666666666666666 (* y (* (sin x) y))))))))
double code(double x, double y) {
double t_0 = x + (x * (y * (y * 0.16666666666666666)));
double tmp;
if (y <= -0.038) {
tmp = t_0;
} else if (y <= 8.2e+29) {
tmp = sin(x);
} else if (y <= 5.6e+224) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = x + (x * (y * (y * 0.16666666666666666d0)))
if (y <= (-0.038d0)) then
tmp = t_0
else if (y <= 8.2d+29) then
tmp = sin(x)
else if (y <= 5.6d+224) then
tmp = t_0
else
tmp = 0.16666666666666666d0 * (y * (sin(x) * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (x * (y * (y * 0.16666666666666666)));
double tmp;
if (y <= -0.038) {
tmp = t_0;
} else if (y <= 8.2e+29) {
tmp = Math.sin(x);
} else if (y <= 5.6e+224) {
tmp = t_0;
} else {
tmp = 0.16666666666666666 * (y * (Math.sin(x) * y));
}
return tmp;
}
def code(x, y): t_0 = x + (x * (y * (y * 0.16666666666666666))) tmp = 0 if y <= -0.038: tmp = t_0 elif y <= 8.2e+29: tmp = math.sin(x) elif y <= 5.6e+224: tmp = t_0 else: tmp = 0.16666666666666666 * (y * (math.sin(x) * y)) return tmp
function code(x, y) t_0 = Float64(x + Float64(x * Float64(y * Float64(y * 0.16666666666666666)))) tmp = 0.0 if (y <= -0.038) tmp = t_0; elseif (y <= 8.2e+29) tmp = sin(x); elseif (y <= 5.6e+224) tmp = t_0; else tmp = Float64(0.16666666666666666 * Float64(y * Float64(sin(x) * y))); end return tmp end
function tmp_2 = code(x, y) t_0 = x + (x * (y * (y * 0.16666666666666666))); tmp = 0.0; if (y <= -0.038) tmp = t_0; elseif (y <= 8.2e+29) tmp = sin(x); elseif (y <= 5.6e+224) tmp = t_0; else tmp = 0.16666666666666666 * (y * (sin(x) * y)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(x * N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.038], t$95$0, If[LessEqual[y, 8.2e+29], N[Sin[x], $MachinePrecision], If[LessEqual[y, 5.6e+224], t$95$0, N[(0.16666666666666666 * N[(y * N[(N[Sin[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + x \cdot \left(y \cdot \left(y \cdot 0.16666666666666666\right)\right)\\
\mathbf{if}\;y \leq -0.038:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+29}:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{+224}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(\sin x \cdot y\right)\right)\\
\end{array}
\end{array}
if y < -0.0379999999999999991 or 8.2000000000000007e29 < y < 5.60000000000000016e224Initial program 100.0%
Taylor expanded in y around 0 47.8%
associate-*r*47.8%
distribute-rgt1-in47.8%
unpow247.8%
Simplified47.8%
Taylor expanded in y around 0 47.8%
unpow247.8%
associate-*r*47.0%
*-commutative47.0%
Simplified47.0%
Taylor expanded in x around 0 40.5%
*-commutative40.5%
+-commutative40.5%
unpow240.5%
fma-udef40.5%
Simplified40.5%
fma-udef40.5%
distribute-rgt-in40.5%
*-commutative40.5%
associate-*r*40.5%
*-un-lft-identity40.5%
Applied egg-rr40.5%
if -0.0379999999999999991 < y < 8.2000000000000007e29Initial program 100.0%
Taylor expanded in y around 0 94.4%
if 5.60000000000000016e224 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
associate-*r*100.0%
distribute-rgt1-in100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
unpow2100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
unpow2100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
unpow2100.0%
associate-*l*94.8%
Simplified94.8%
Final simplification74.0%
(FPCore (x y) :precision binary64 (if (or (<= y -2.5) (not (<= y 2.5))) (* 0.16666666666666666 (* (sin x) (* y y))) (sin x)))
double code(double x, double y) {
double tmp;
if ((y <= -2.5) || !(y <= 2.5)) {
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.5d0))) 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.5)) {
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.5): 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.5)) 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.5))) 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.5]], $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.5\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.5 < y Initial program 100.0%
Taylor expanded in y around 0 52.9%
associate-*r*52.9%
distribute-rgt1-in52.9%
unpow252.9%
Simplified52.9%
Taylor expanded in y around 0 52.9%
unpow252.9%
associate-*r*52.3%
*-commutative52.3%
Simplified52.3%
Taylor expanded in y around inf 52.9%
unpow252.9%
*-commutative52.9%
Simplified52.9%
if -2.5 < y < 2.5Initial program 100.0%
Taylor expanded in y around 0 98.2%
Final simplification77.0%
(FPCore (x y) :precision binary64 (* (sin x) (+ (* 0.16666666666666666 (* y y)) 1.0)))
double code(double x, double y) {
return sin(x) * ((0.16666666666666666 * (y * y)) + 1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * ((0.16666666666666666d0 * (y * y)) + 1.0d0)
end function
public static double code(double x, double y) {
return Math.sin(x) * ((0.16666666666666666 * (y * y)) + 1.0);
}
def code(x, y): return math.sin(x) * ((0.16666666666666666 * (y * y)) + 1.0)
function code(x, y) return Float64(sin(x) * Float64(Float64(0.16666666666666666 * Float64(y * y)) + 1.0)) end
function tmp = code(x, y) tmp = sin(x) * ((0.16666666666666666 * (y * y)) + 1.0); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right) + 1\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0 77.3%
associate-*r*77.3%
distribute-rgt1-in77.3%
unpow277.3%
Simplified77.3%
Final simplification77.3%
(FPCore (x y) :precision binary64 (if (or (<= y -0.00165) (not (<= y 7e+29))) (+ x (* x (* y (* y 0.16666666666666666)))) (sin x)))
double code(double x, double y) {
double tmp;
if ((y <= -0.00165) || !(y <= 7e+29)) {
tmp = x + (x * (y * (y * 0.16666666666666666)));
} 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 <= (-0.00165d0)) .or. (.not. (y <= 7d+29))) then
tmp = x + (x * (y * (y * 0.16666666666666666d0)))
else
tmp = sin(x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -0.00165) || !(y <= 7e+29)) {
tmp = x + (x * (y * (y * 0.16666666666666666)));
} else {
tmp = Math.sin(x);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -0.00165) or not (y <= 7e+29): tmp = x + (x * (y * (y * 0.16666666666666666))) else: tmp = math.sin(x) return tmp
function code(x, y) tmp = 0.0 if ((y <= -0.00165) || !(y <= 7e+29)) tmp = Float64(x + Float64(x * Float64(y * Float64(y * 0.16666666666666666)))); else tmp = sin(x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -0.00165) || ~((y <= 7e+29))) tmp = x + (x * (y * (y * 0.16666666666666666))); else tmp = sin(x); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -0.00165], N[Not[LessEqual[y, 7e+29]], $MachinePrecision]], N[(x + N[(x * N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[x], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00165 \lor \neg \left(y \leq 7 \cdot 10^{+29}\right):\\
\;\;\;\;x + x \cdot \left(y \cdot \left(y \cdot 0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin x\\
\end{array}
\end{array}
if y < -0.00165 or 6.99999999999999958e29 < y Initial program 100.0%
Taylor expanded in y around 0 55.9%
associate-*r*55.9%
distribute-rgt1-in55.9%
unpow255.9%
Simplified55.9%
Taylor expanded in y around 0 55.9%
unpow255.9%
associate-*r*55.3%
*-commutative55.3%
Simplified55.3%
Taylor expanded in x around 0 45.5%
*-commutative45.5%
+-commutative45.5%
unpow245.5%
fma-udef45.5%
Simplified45.5%
fma-udef45.5%
distribute-rgt-in45.5%
*-commutative45.5%
associate-*r*45.5%
*-un-lft-identity45.5%
Applied egg-rr45.5%
if -0.00165 < y < 6.99999999999999958e29Initial program 100.0%
Taylor expanded in y around 0 94.4%
Final simplification72.4%
(FPCore (x y) :precision binary64 (if (or (<= y -2.8e+25) (not (<= y 4e-8))) (* 0.16666666666666666 (* y (* x y))) x))
double code(double x, double y) {
double tmp;
if ((y <= -2.8e+25) || !(y <= 4e-8)) {
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 <= (-2.8d+25)) .or. (.not. (y <= 4d-8))) 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 <= -2.8e+25) || !(y <= 4e-8)) {
tmp = 0.16666666666666666 * (y * (x * y));
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -2.8e+25) or not (y <= 4e-8): tmp = 0.16666666666666666 * (y * (x * y)) else: tmp = x return tmp
function code(x, y) tmp = 0.0 if ((y <= -2.8e+25) || !(y <= 4e-8)) 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 <= -2.8e+25) || ~((y <= 4e-8))) tmp = 0.16666666666666666 * (y * (x * y)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -2.8e+25], N[Not[LessEqual[y, 4e-8]], $MachinePrecision]], N[(0.16666666666666666 * N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+25} \lor \neg \left(y \leq 4 \cdot 10^{-8}\right):\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.8000000000000002e25 or 4.0000000000000001e-8 < y Initial program 100.0%
Taylor expanded in y around 0 55.1%
associate-*r*55.1%
distribute-rgt1-in55.1%
unpow255.1%
Simplified55.1%
Taylor expanded in y around 0 55.1%
unpow255.1%
associate-*r*54.5%
*-commutative54.5%
Simplified54.5%
Taylor expanded in y around inf 53.6%
unpow253.6%
*-commutative53.6%
Simplified53.6%
Taylor expanded in x around 0 43.2%
unpow243.2%
associate-*l*28.4%
Simplified28.4%
if -2.8000000000000002e25 < y < 4.0000000000000001e-8Initial program 100.0%
Taylor expanded in y around 0 96.5%
associate-*r*96.5%
distribute-rgt1-in96.5%
unpow296.5%
Simplified96.5%
Taylor expanded in y around 0 96.5%
unpow296.5%
associate-*r*96.5%
*-commutative96.5%
Simplified96.5%
Taylor expanded in x around 0 47.1%
*-commutative47.1%
+-commutative47.1%
unpow247.1%
fma-udef47.1%
Simplified47.1%
Taylor expanded in y around 0 46.9%
Final simplification38.3%
(FPCore (x y) :precision binary64 (if (or (<= y -2.8e+25) (not (<= y 4e-8))) (* 0.16666666666666666 (* x (* y y))) x))
double code(double x, double y) {
double tmp;
if ((y <= -2.8e+25) || !(y <= 4e-8)) {
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 <= (-2.8d+25)) .or. (.not. (y <= 4d-8))) 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 <= -2.8e+25) || !(y <= 4e-8)) {
tmp = 0.16666666666666666 * (x * (y * y));
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -2.8e+25) or not (y <= 4e-8): tmp = 0.16666666666666666 * (x * (y * y)) else: tmp = x return tmp
function code(x, y) tmp = 0.0 if ((y <= -2.8e+25) || !(y <= 4e-8)) 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 <= -2.8e+25) || ~((y <= 4e-8))) tmp = 0.16666666666666666 * (x * (y * y)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -2.8e+25], N[Not[LessEqual[y, 4e-8]], $MachinePrecision]], N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+25} \lor \neg \left(y \leq 4 \cdot 10^{-8}\right):\\
\;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.8000000000000002e25 or 4.0000000000000001e-8 < y Initial program 100.0%
Taylor expanded in y around 0 55.1%
associate-*r*55.1%
distribute-rgt1-in55.1%
unpow255.1%
Simplified55.1%
Taylor expanded in y around 0 55.1%
unpow255.1%
associate-*r*54.5%
*-commutative54.5%
Simplified54.5%
Taylor expanded in y around inf 53.6%
unpow253.6%
*-commutative53.6%
Simplified53.6%
Taylor expanded in x around 0 43.2%
unpow243.2%
Simplified43.2%
if -2.8000000000000002e25 < y < 4.0000000000000001e-8Initial program 100.0%
Taylor expanded in y around 0 96.5%
associate-*r*96.5%
distribute-rgt1-in96.5%
unpow296.5%
Simplified96.5%
Taylor expanded in y around 0 96.5%
unpow296.5%
associate-*r*96.5%
*-commutative96.5%
Simplified96.5%
Taylor expanded in x around 0 47.1%
*-commutative47.1%
+-commutative47.1%
unpow247.1%
fma-udef47.1%
Simplified47.1%
Taylor expanded in y around 0 46.9%
Final simplification45.1%
(FPCore (x y) :precision binary64 (if (<= y -2.8e+25) (* x (* y (* y 0.16666666666666666))) (if (<= y 4e-8) x (* 0.16666666666666666 (* x (* y y))))))
double code(double x, double y) {
double tmp;
if (y <= -2.8e+25) {
tmp = x * (y * (y * 0.16666666666666666));
} else if (y <= 4e-8) {
tmp = x;
} else {
tmp = 0.16666666666666666 * (x * (y * y));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-2.8d+25)) then
tmp = x * (y * (y * 0.16666666666666666d0))
else if (y <= 4d-8) then
tmp = x
else
tmp = 0.16666666666666666d0 * (x * (y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -2.8e+25) {
tmp = x * (y * (y * 0.16666666666666666));
} else if (y <= 4e-8) {
tmp = x;
} else {
tmp = 0.16666666666666666 * (x * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.8e+25: tmp = x * (y * (y * 0.16666666666666666)) elif y <= 4e-8: tmp = x else: tmp = 0.16666666666666666 * (x * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= -2.8e+25) tmp = Float64(x * Float64(y * Float64(y * 0.16666666666666666))); elseif (y <= 4e-8) tmp = x; else tmp = Float64(0.16666666666666666 * Float64(x * Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2.8e+25) tmp = x * (y * (y * 0.16666666666666666)); elseif (y <= 4e-8) tmp = x; else tmp = 0.16666666666666666 * (x * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.8e+25], N[(x * N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e-8], x, N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+25}:\\
\;\;\;\;x \cdot \left(y \cdot \left(y \cdot 0.16666666666666666\right)\right)\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-8}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < -2.8000000000000002e25Initial program 100.0%
Taylor expanded in y around 0 51.4%
associate-*r*51.4%
distribute-rgt1-in51.4%
unpow251.4%
Simplified51.4%
Taylor expanded in y around 0 51.4%
unpow251.4%
associate-*r*49.9%
*-commutative49.9%
Simplified49.9%
Taylor expanded in y around inf 51.4%
unpow251.4%
*-commutative51.4%
Simplified51.4%
Taylor expanded in x around 0 42.8%
associate-*r*42.8%
*-commutative42.8%
unpow242.8%
associate-*r*42.8%
*-commutative42.8%
Simplified42.8%
if -2.8000000000000002e25 < y < 4.0000000000000001e-8Initial program 100.0%
Taylor expanded in y around 0 96.5%
associate-*r*96.5%
distribute-rgt1-in96.5%
unpow296.5%
Simplified96.5%
Taylor expanded in y around 0 96.5%
unpow296.5%
associate-*r*96.5%
*-commutative96.5%
Simplified96.5%
Taylor expanded in x around 0 47.1%
*-commutative47.1%
+-commutative47.1%
unpow247.1%
fma-udef47.1%
Simplified47.1%
Taylor expanded in y around 0 46.9%
if 4.0000000000000001e-8 < y Initial program 100.0%
Taylor expanded in y around 0 58.2%
associate-*r*58.2%
distribute-rgt1-in58.2%
unpow258.2%
Simplified58.2%
Taylor expanded in y around 0 58.2%
unpow258.2%
associate-*r*58.2%
*-commutative58.2%
Simplified58.2%
Taylor expanded in y around inf 55.3%
unpow255.3%
*-commutative55.3%
Simplified55.3%
Taylor expanded in x around 0 43.5%
unpow243.5%
Simplified43.5%
Final simplification45.1%
(FPCore (x y) :precision binary64 (+ x (* x (* y (* y 0.16666666666666666)))))
double code(double x, double y) {
return x + (x * (y * (y * 0.16666666666666666)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + (x * (y * (y * 0.16666666666666666d0)))
end function
public static double code(double x, double y) {
return x + (x * (y * (y * 0.16666666666666666)));
}
def code(x, y): return x + (x * (y * (y * 0.16666666666666666)))
function code(x, y) return Float64(x + Float64(x * Float64(y * Float64(y * 0.16666666666666666)))) end
function tmp = code(x, y) tmp = x + (x * (y * (y * 0.16666666666666666))); end
code[x_, y_] := N[(x + N[(x * N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + x \cdot \left(y \cdot \left(y \cdot 0.16666666666666666\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0 77.3%
associate-*r*77.3%
distribute-rgt1-in77.3%
unpow277.3%
Simplified77.3%
Taylor expanded in y around 0 77.3%
unpow277.3%
associate-*r*77.0%
*-commutative77.0%
Simplified77.0%
Taylor expanded in x around 0 45.3%
*-commutative45.3%
+-commutative45.3%
unpow245.3%
fma-udef45.3%
Simplified45.3%
fma-udef45.3%
distribute-rgt-in45.3%
*-commutative45.3%
associate-*r*45.3%
*-un-lft-identity45.3%
Applied egg-rr45.3%
Final simplification45.3%
(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 77.3%
associate-*r*77.3%
distribute-rgt1-in77.3%
unpow277.3%
Simplified77.3%
Taylor expanded in y around 0 77.3%
unpow277.3%
associate-*r*77.0%
*-commutative77.0%
Simplified77.0%
Taylor expanded in x around 0 45.3%
*-commutative45.3%
+-commutative45.3%
unpow245.3%
fma-udef45.3%
Simplified45.3%
Taylor expanded in y around 0 26.1%
Final simplification26.1%
herbie shell --seed 2023174
(FPCore (x y)
:name "Linear.Quaternion:$ccos from linear-1.19.1.3"
:precision binary64
(* (sin x) (/ (sinh y) y)))