
(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 10 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
(let* ((t_0 (* 0.16666666666666666 (* y y))))
(if (<= y 3500000000.0)
(* (sin x) (+ 1.0 t_0))
(if (<= y 1.4e+154)
(*
0.16666666666666666
(* y (* y (+ x (* (pow x 3.0) -0.16666666666666666)))))
(* (sin x) t_0)))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double tmp;
if (y <= 3500000000.0) {
tmp = sin(x) * (1.0 + t_0);
} else if (y <= 1.4e+154) {
tmp = 0.16666666666666666 * (y * (y * (x + (pow(x, 3.0) * -0.16666666666666666))));
} else {
tmp = sin(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 <= 3500000000.0d0) then
tmp = sin(x) * (1.0d0 + t_0)
else if (y <= 1.4d+154) then
tmp = 0.16666666666666666d0 * (y * (y * (x + ((x ** 3.0d0) * (-0.16666666666666666d0)))))
else
tmp = sin(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 <= 3500000000.0) {
tmp = Math.sin(x) * (1.0 + t_0);
} else if (y <= 1.4e+154) {
tmp = 0.16666666666666666 * (y * (y * (x + (Math.pow(x, 3.0) * -0.16666666666666666))));
} else {
tmp = Math.sin(x) * t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (y * y) tmp = 0 if y <= 3500000000.0: tmp = math.sin(x) * (1.0 + t_0) elif y <= 1.4e+154: tmp = 0.16666666666666666 * (y * (y * (x + (math.pow(x, 3.0) * -0.16666666666666666)))) else: tmp = math.sin(x) * t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(y * y)) tmp = 0.0 if (y <= 3500000000.0) tmp = Float64(sin(x) * Float64(1.0 + t_0)); elseif (y <= 1.4e+154) tmp = Float64(0.16666666666666666 * Float64(y * Float64(y * Float64(x + Float64((x ^ 3.0) * -0.16666666666666666))))); else tmp = Float64(sin(x) * t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (y * y); tmp = 0.0; if (y <= 3500000000.0) tmp = sin(x) * (1.0 + t_0); elseif (y <= 1.4e+154) tmp = 0.16666666666666666 * (y * (y * (x + ((x ^ 3.0) * -0.16666666666666666)))); else tmp = sin(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, 3500000000.0], N[(N[Sin[x], $MachinePrecision] * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+154], N[(0.16666666666666666 * N[(y * N[(y * N[(x + N[(N[Power[x, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[x], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 3500000000:\\
\;\;\;\;\sin x \cdot \left(1 + t_0\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(y \cdot \left(x + {x}^{3} \cdot -0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin x \cdot t_0\\
\end{array}
\end{array}
if y < 3.5e9Initial program 100.0%
Taylor expanded in y around 0 87.3%
unpow287.3%
Simplified87.3%
if 3.5e9 < y < 1.4e154Initial program 100.0%
Taylor expanded in y around 0 4.7%
unpow24.7%
Simplified4.7%
Taylor expanded in y around inf 4.7%
unpow24.7%
associate-*l*4.7%
Simplified4.7%
Taylor expanded in x around 0 17.2%
+-commutative17.2%
*-commutative17.2%
associate-*l*17.2%
distribute-lft-out26.3%
Simplified26.3%
if 1.4e154 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
unpow2100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Final simplification81.3%
(FPCore (x y)
:precision binary64
(if (<= y 1.12e-16)
(sin x)
(if (<= y 3e+238)
(* x (+ 1.0 (* 0.16666666666666666 (* y y))))
(* 0.16666666666666666 (* y (* (sin x) y))))))
double code(double x, double y) {
double tmp;
if (y <= 1.12e-16) {
tmp = sin(x);
} else if (y <= 3e+238) {
tmp = x * (1.0 + (0.16666666666666666 * (y * y)));
} 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 <= 1.12d-16) then
tmp = sin(x)
else if (y <= 3d+238) then
tmp = x * (1.0d0 + (0.16666666666666666d0 * (y * y)))
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 <= 1.12e-16) {
tmp = Math.sin(x);
} else if (y <= 3e+238) {
tmp = x * (1.0 + (0.16666666666666666 * (y * y)));
} else {
tmp = 0.16666666666666666 * (y * (Math.sin(x) * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.12e-16: tmp = math.sin(x) elif y <= 3e+238: tmp = x * (1.0 + (0.16666666666666666 * (y * y))) else: tmp = 0.16666666666666666 * (y * (math.sin(x) * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.12e-16) tmp = sin(x); elseif (y <= 3e+238) tmp = Float64(x * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); 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 <= 1.12e-16) tmp = sin(x); elseif (y <= 3e+238) tmp = x * (1.0 + (0.16666666666666666 * (y * y))); else tmp = 0.16666666666666666 * (y * (sin(x) * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.12e-16], N[Sin[x], $MachinePrecision], If[LessEqual[y, 3e+238], N[(x * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 1.12 \cdot 10^{-16}:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+238}:\\
\;\;\;\;x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(\sin x \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 1.12e-16Initial program 100.0%
Taylor expanded in y around 0 87.7%
unpow287.7%
Simplified87.7%
Taylor expanded in y around 0 69.9%
if 1.12e-16 < y < 3e238Initial program 100.0%
Taylor expanded in y around 0 41.0%
unpow241.0%
Simplified41.0%
Taylor expanded in x around 0 38.0%
+-commutative38.0%
unpow238.0%
fma-udef38.0%
Simplified38.0%
fma-udef38.0%
Applied egg-rr38.0%
if 3e238 < y Initial program 100.0%
Taylor expanded in y around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
unpow2100.0%
associate-*l*89.7%
Simplified89.7%
Final simplification64.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.16666666666666666 (* y y))))
(if (<= y 1.12e-16)
(sin x)
(if (<= y 5.2e+139) (* x (+ 1.0 t_0)) (* (sin x) t_0)))))
double code(double x, double y) {
double t_0 = 0.16666666666666666 * (y * y);
double tmp;
if (y <= 1.12e-16) {
tmp = sin(x);
} else if (y <= 5.2e+139) {
tmp = x * (1.0 + t_0);
} else {
tmp = sin(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 <= 1.12d-16) then
tmp = sin(x)
else if (y <= 5.2d+139) then
tmp = x * (1.0d0 + t_0)
else
tmp = sin(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 <= 1.12e-16) {
tmp = Math.sin(x);
} else if (y <= 5.2e+139) {
tmp = x * (1.0 + t_0);
} else {
tmp = Math.sin(x) * t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.16666666666666666 * (y * y) tmp = 0 if y <= 1.12e-16: tmp = math.sin(x) elif y <= 5.2e+139: tmp = x * (1.0 + t_0) else: tmp = math.sin(x) * t_0 return tmp
function code(x, y) t_0 = Float64(0.16666666666666666 * Float64(y * y)) tmp = 0.0 if (y <= 1.12e-16) tmp = sin(x); elseif (y <= 5.2e+139) tmp = Float64(x * Float64(1.0 + t_0)); else tmp = Float64(sin(x) * t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = 0.16666666666666666 * (y * y); tmp = 0.0; if (y <= 1.12e-16) tmp = sin(x); elseif (y <= 5.2e+139) tmp = x * (1.0 + t_0); else tmp = sin(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, 1.12e-16], N[Sin[x], $MachinePrecision], If[LessEqual[y, 5.2e+139], N[(x * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Sin[x], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 1.12 \cdot 10^{-16}:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+139}:\\
\;\;\;\;x \cdot \left(1 + t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\sin x \cdot t_0\\
\end{array}
\end{array}
if y < 1.12e-16Initial program 100.0%
Taylor expanded in y around 0 87.7%
unpow287.7%
Simplified87.7%
Taylor expanded in y around 0 69.9%
if 1.12e-16 < y < 5.20000000000000044e139Initial program 100.0%
Taylor expanded in y around 0 7.3%
unpow27.3%
Simplified7.3%
Taylor expanded in x around 0 15.9%
+-commutative15.9%
unpow215.9%
fma-udef15.9%
Simplified15.9%
fma-udef15.9%
Applied egg-rr15.9%
if 5.20000000000000044e139 < y Initial program 100.0%
Taylor expanded in y around 0 89.2%
unpow289.2%
Simplified89.2%
Taylor expanded in y around inf 89.2%
unpow289.2%
associate-*r*89.2%
*-commutative89.2%
Simplified89.2%
Final simplification66.8%
(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 78.5%
unpow278.5%
Simplified78.5%
Final simplification78.5%
(FPCore (x y) :precision binary64 (if (<= y 1.12e-16) (sin x) (* x (+ 1.0 (* 0.16666666666666666 (* y y))))))
double code(double x, double y) {
double tmp;
if (y <= 1.12e-16) {
tmp = sin(x);
} else {
tmp = x * (1.0 + (0.16666666666666666 * (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 <= 1.12d-16) then
tmp = sin(x)
else
tmp = x * (1.0d0 + (0.16666666666666666d0 * (y * y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.12e-16) {
tmp = Math.sin(x);
} else {
tmp = x * (1.0 + (0.16666666666666666 * (y * y)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.12e-16: tmp = math.sin(x) else: tmp = x * (1.0 + (0.16666666666666666 * (y * y))) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.12e-16) tmp = sin(x); else tmp = Float64(x * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.12e-16) tmp = sin(x); else tmp = x * (1.0 + (0.16666666666666666 * (y * y))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.12e-16], N[Sin[x], $MachinePrecision], N[(x * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.12 \cdot 10^{-16}:\\
\;\;\;\;\sin x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 1.12e-16Initial program 100.0%
Taylor expanded in y around 0 87.7%
unpow287.7%
Simplified87.7%
Taylor expanded in y around 0 69.9%
if 1.12e-16 < y Initial program 100.0%
Taylor expanded in y around 0 55.6%
unpow255.6%
Simplified55.6%
Taylor expanded in x around 0 39.6%
+-commutative39.6%
unpow239.6%
fma-udef39.6%
Simplified39.6%
fma-udef39.6%
Applied egg-rr39.6%
Final simplification61.3%
(FPCore (x y) :precision binary64 (if (<= y 2.45) x (* 0.16666666666666666 (* y (* x y)))))
double code(double x, double y) {
double tmp;
if (y <= 2.45) {
tmp = x;
} else {
tmp = 0.16666666666666666 * (y * (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 <= 2.45d0) then
tmp = x
else
tmp = 0.16666666666666666d0 * (y * (x * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.45) {
tmp = x;
} else {
tmp = 0.16666666666666666 * (y * (x * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.45: tmp = x else: tmp = 0.16666666666666666 * (y * (x * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.45) tmp = x; else tmp = Float64(0.16666666666666666 * Float64(y * Float64(x * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.45) tmp = x; else tmp = 0.16666666666666666 * (y * (x * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.45], x, N[(0.16666666666666666 * N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.45:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(x \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 2.4500000000000002Initial program 100.0%
Taylor expanded in y around 0 87.8%
unpow287.8%
Simplified87.8%
Taylor expanded in x around 0 51.0%
+-commutative51.0%
unpow251.0%
fma-udef51.0%
Simplified51.0%
Taylor expanded in y around 0 35.7%
if 2.4500000000000002 < y Initial program 100.0%
Taylor expanded in y around 0 55.0%
unpow255.0%
Simplified55.0%
Taylor expanded in y around inf 55.0%
unpow255.0%
associate-*l*38.1%
Simplified38.1%
Taylor expanded in x around 0 38.7%
unpow238.7%
associate-*l*21.9%
Simplified21.9%
Final simplification31.8%
(FPCore (x y) :precision binary64 (if (<= y 2.45) x (* 0.16666666666666666 (* x (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 2.45) {
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.45d0) 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.45) {
tmp = x;
} else {
tmp = 0.16666666666666666 * (x * (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.45: tmp = x else: tmp = 0.16666666666666666 * (x * (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.45) 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.45) tmp = x; else tmp = 0.16666666666666666 * (x * (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.45], x, N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.45:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < 2.4500000000000002Initial program 100.0%
Taylor expanded in y around 0 87.8%
unpow287.8%
Simplified87.8%
Taylor expanded in x around 0 51.0%
+-commutative51.0%
unpow251.0%
fma-udef51.0%
Simplified51.0%
Taylor expanded in y around 0 35.7%
if 2.4500000000000002 < y Initial program 100.0%
Taylor expanded in y around 0 55.0%
unpow255.0%
Simplified55.0%
Taylor expanded in y around inf 55.0%
unpow255.0%
associate-*l*38.1%
Simplified38.1%
Taylor expanded in x around 0 38.7%
unpow238.7%
Simplified38.7%
Final simplification36.5%
(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 78.5%
unpow278.5%
Simplified78.5%
Taylor expanded in x around 0 47.6%
+-commutative47.6%
unpow247.6%
fma-udef47.6%
Simplified47.6%
fma-udef47.6%
Applied egg-rr47.6%
Final simplification47.6%
(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 78.5%
unpow278.5%
Simplified78.5%
Taylor expanded in x around 0 47.6%
+-commutative47.6%
unpow247.6%
fma-udef47.6%
Simplified47.6%
Taylor expanded in y around 0 26.2%
Final simplification26.2%
herbie shell --seed 2023229
(FPCore (x y)
:name "Linear.Quaternion:$ccos from linear-1.19.1.3"
:precision binary64
(* (sin x) (/ (sinh y) y)))