
(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) (/ 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%
add-log-exp83.2%
*-un-lft-identity83.2%
log-prod83.2%
metadata-eval83.2%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/94.0%
associate-*l/88.5%
associate-/r/100.0%
Simplified100.0%
(FPCore (x y) :precision binary64 (let* ((t_0 (/ (sinh y) y))) (if (<= t_0 1.5) (sin x) (* x t_0))))
double code(double x, double y) {
double t_0 = sinh(y) / y;
double tmp;
if (t_0 <= 1.5) {
tmp = sin(x);
} else {
tmp = 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 = sinh(y) / y
if (t_0 <= 1.5d0) then
tmp = sin(x)
else
tmp = x * t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sinh(y) / y;
double tmp;
if (t_0 <= 1.5) {
tmp = Math.sin(x);
} else {
tmp = x * t_0;
}
return tmp;
}
def code(x, y): t_0 = math.sinh(y) / y tmp = 0 if t_0 <= 1.5: tmp = math.sin(x) else: tmp = x * t_0 return tmp
function code(x, y) t_0 = Float64(sinh(y) / y) tmp = 0.0 if (t_0 <= 1.5) tmp = sin(x); else tmp = Float64(x * t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = sinh(y) / y; tmp = 0.0; if (t_0 <= 1.5) tmp = sin(x); else tmp = x * t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t$95$0, 1.5], N[Sin[x], $MachinePrecision], N[(x * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sinh y}{y}\\
\mathbf{if}\;t\_0 \leq 1.5:\\
\;\;\;\;\sin x\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\_0\\
\end{array}
\end{array}
if (/.f64 (sinh.f64 y) y) < 1.5Initial program 100.0%
Taylor expanded in y around 0 99.5%
if 1.5 < (/.f64 (sinh.f64 y) y) Initial program 100.0%
Taylor expanded in x around 0 77.4%
(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%
(FPCore (x y)
:precision binary64
(if (<= y 0.0054)
(sin x)
(if (<= y 6.9e+226)
(* x (* (sinh y) (/ 1.0 y)))
(* (/ 1.0 y) (/ (* y (* (sin x) y)) y)))))
double code(double x, double y) {
double tmp;
if (y <= 0.0054) {
tmp = sin(x);
} else if (y <= 6.9e+226) {
tmp = x * (sinh(y) * (1.0 / y));
} else {
tmp = (1.0 / y) * ((y * (sin(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 <= 0.0054d0) then
tmp = sin(x)
else if (y <= 6.9d+226) then
tmp = x * (sinh(y) * (1.0d0 / y))
else
tmp = (1.0d0 / y) * ((y * (sin(x) * y)) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 0.0054) {
tmp = Math.sin(x);
} else if (y <= 6.9e+226) {
tmp = x * (Math.sinh(y) * (1.0 / y));
} else {
tmp = (1.0 / y) * ((y * (Math.sin(x) * y)) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 0.0054: tmp = math.sin(x) elif y <= 6.9e+226: tmp = x * (math.sinh(y) * (1.0 / y)) else: tmp = (1.0 / y) * ((y * (math.sin(x) * y)) / y) return tmp
function code(x, y) tmp = 0.0 if (y <= 0.0054) tmp = sin(x); elseif (y <= 6.9e+226) tmp = Float64(x * Float64(sinh(y) * Float64(1.0 / y))); else tmp = Float64(Float64(1.0 / y) * Float64(Float64(y * Float64(sin(x) * y)) / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 0.0054) tmp = sin(x); elseif (y <= 6.9e+226) tmp = x * (sinh(y) * (1.0 / y)); else tmp = (1.0 / y) * ((y * (sin(x) * y)) / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 0.0054], N[Sin[x], $MachinePrecision], If[LessEqual[y, 6.9e+226], N[(x * N[(N[Sinh[y], $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(N[(y * N[(N[Sin[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.0054:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 6.9 \cdot 10^{+226}:\\
\;\;\;\;x \cdot \left(\sinh y \cdot \frac{1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{y \cdot \left(\sin x \cdot y\right)}{y}\\
\end{array}
\end{array}
if y < 0.0054000000000000003Initial program 100.0%
Taylor expanded in y around 0 60.0%
if 0.0054000000000000003 < y < 6.89999999999999959e226Initial program 100.0%
clear-num100.0%
associate-/r/100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 69.3%
if 6.89999999999999959e226 < y Initial program 100.0%
add-log-exp100.0%
*-un-lft-identity100.0%
log-prod100.0%
metadata-eval100.0%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 2.8%
clear-num2.8%
associate-/r/2.8%
*-commutative2.8%
Applied egg-rr2.8%
*-commutative2.8%
*-un-lft-identity2.8%
lft-mult-inverse2.8%
associate-*r*2.8%
associate-*l/2.8%
*-un-lft-identity2.8%
associate-*l/94.5%
Applied egg-rr94.5%
Final simplification64.3%
(FPCore (x y) :precision binary64 (if (<= y 0.008) (sin x) (* x (* (sinh y) (/ 1.0 y)))))
double code(double x, double y) {
double tmp;
if (y <= 0.008) {
tmp = sin(x);
} else {
tmp = x * (sinh(y) * (1.0 / y));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 0.008d0) then
tmp = sin(x)
else
tmp = x * (sinh(y) * (1.0d0 / y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 0.008) {
tmp = Math.sin(x);
} else {
tmp = x * (Math.sinh(y) * (1.0 / y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 0.008: tmp = math.sin(x) else: tmp = x * (math.sinh(y) * (1.0 / y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 0.008) tmp = sin(x); else tmp = Float64(x * Float64(sinh(y) * Float64(1.0 / y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 0.008) tmp = sin(x); else tmp = x * (sinh(y) * (1.0 / y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 0.008], N[Sin[x], $MachinePrecision], N[(x * N[(N[Sinh[y], $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.008:\\
\;\;\;\;\sin x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\sinh y \cdot \frac{1}{y}\right)\\
\end{array}
\end{array}
if y < 0.0080000000000000002Initial program 100.0%
Taylor expanded in y around 0 60.0%
if 0.0080000000000000002 < y Initial program 100.0%
clear-num100.0%
associate-/r/100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 68.6%
Final simplification62.4%
(FPCore (x y)
:precision binary64
(if (<= y 1.9e+15)
(sin x)
(if (<= y 4.85e+116)
(* x (+ (* (/ (* (* x y) (* x y)) (* y y)) -0.16666666666666666) 1.0))
(/ (/ (* y (* x y)) y) y))))
double code(double x, double y) {
double tmp;
if (y <= 1.9e+15) {
tmp = sin(x);
} else if (y <= 4.85e+116) {
tmp = x * (((((x * y) * (x * y)) / (y * y)) * -0.16666666666666666) + 1.0);
} else {
tmp = ((y * (x * y)) / 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.9d+15) then
tmp = sin(x)
else if (y <= 4.85d+116) then
tmp = x * (((((x * y) * (x * y)) / (y * y)) * (-0.16666666666666666d0)) + 1.0d0)
else
tmp = ((y * (x * y)) / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.9e+15) {
tmp = Math.sin(x);
} else if (y <= 4.85e+116) {
tmp = x * (((((x * y) * (x * y)) / (y * y)) * -0.16666666666666666) + 1.0);
} else {
tmp = ((y * (x * y)) / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.9e+15: tmp = math.sin(x) elif y <= 4.85e+116: tmp = x * (((((x * y) * (x * y)) / (y * y)) * -0.16666666666666666) + 1.0) else: tmp = ((y * (x * y)) / y) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 1.9e+15) tmp = sin(x); elseif (y <= 4.85e+116) tmp = Float64(x * Float64(Float64(Float64(Float64(Float64(x * y) * Float64(x * y)) / Float64(y * y)) * -0.16666666666666666) + 1.0)); else tmp = Float64(Float64(Float64(y * Float64(x * y)) / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.9e+15) tmp = sin(x); elseif (y <= 4.85e+116) tmp = x * (((((x * y) * (x * y)) / (y * y)) * -0.16666666666666666) + 1.0); else tmp = ((y * (x * y)) / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.9e+15], N[Sin[x], $MachinePrecision], If[LessEqual[y, 4.85e+116], N[(x * N[(N[(N[(N[(N[(x * y), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.9 \cdot 10^{+15}:\\
\;\;\;\;\sin x\\
\mathbf{elif}\;y \leq 4.85 \cdot 10^{+116}:\\
\;\;\;\;x \cdot \left(\frac{\left(x \cdot y\right) \cdot \left(x \cdot y\right)}{y \cdot y} \cdot -0.16666666666666666 + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y \cdot \left(x \cdot y\right)}{y}}{y}\\
\end{array}
\end{array}
if y < 1.9e15Initial program 100.0%
Taylor expanded in y around 0 58.3%
if 1.9e15 < y < 4.8499999999999999e116Initial program 100.0%
Taylor expanded in y around 0 2.8%
Taylor expanded in x around 0 33.3%
*-commutative33.3%
Simplified33.3%
unpow233.3%
Applied egg-rr33.3%
*-rgt-identity33.3%
lft-mult-inverse33.3%
*-commutative33.3%
associate-*l*33.3%
div-inv33.3%
*-rgt-identity33.3%
lft-mult-inverse33.3%
*-commutative33.3%
associate-*l*33.3%
div-inv33.3%
frac-2neg33.3%
frac-times37.5%
*-commutative37.5%
distribute-rgt-neg-in37.5%
Applied egg-rr37.5%
if 4.8499999999999999e116 < y Initial program 100.0%
add-log-exp100.0%
*-un-lft-identity100.0%
log-prod100.0%
metadata-eval100.0%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 2.8%
Taylor expanded in x around 0 24.9%
*-un-lft-identity24.9%
*-commutative24.9%
lft-mult-inverse24.9%
associate-*l*24.9%
div-inv24.9%
associate-*l/43.4%
*-commutative43.4%
Applied egg-rr43.4%
Final simplification54.1%
(FPCore (x y) :precision binary64 (if (<= y 4.85e+116) (* x (+ (* -0.16666666666666666 (* x x)) 1.0)) (/ (/ (* y (* x y)) y) y)))
double code(double x, double y) {
double tmp;
if (y <= 4.85e+116) {
tmp = x * ((-0.16666666666666666 * (x * x)) + 1.0);
} else {
tmp = ((y * (x * y)) / 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 <= 4.85d+116) then
tmp = x * (((-0.16666666666666666d0) * (x * x)) + 1.0d0)
else
tmp = ((y * (x * y)) / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 4.85e+116) {
tmp = x * ((-0.16666666666666666 * (x * x)) + 1.0);
} else {
tmp = ((y * (x * y)) / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 4.85e+116: tmp = x * ((-0.16666666666666666 * (x * x)) + 1.0) else: tmp = ((y * (x * y)) / y) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 4.85e+116) tmp = Float64(x * Float64(Float64(-0.16666666666666666 * Float64(x * x)) + 1.0)); else tmp = Float64(Float64(Float64(y * Float64(x * y)) / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 4.85e+116) tmp = x * ((-0.16666666666666666 * (x * x)) + 1.0); else tmp = ((y * (x * y)) / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 4.85e+116], N[(x * N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.85 \cdot 10^{+116}:\\
\;\;\;\;x \cdot \left(-0.16666666666666666 \cdot \left(x \cdot x\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y \cdot \left(x \cdot y\right)}{y}}{y}\\
\end{array}
\end{array}
if y < 4.8499999999999999e116Initial program 100.0%
Taylor expanded in y around 0 52.6%
Taylor expanded in x around 0 30.3%
*-commutative30.3%
Simplified30.3%
unpow230.3%
Applied egg-rr30.3%
if 4.8499999999999999e116 < y Initial program 100.0%
add-log-exp100.0%
*-un-lft-identity100.0%
log-prod100.0%
metadata-eval100.0%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 2.8%
Taylor expanded in x around 0 24.9%
*-un-lft-identity24.9%
*-commutative24.9%
lft-mult-inverse24.9%
associate-*l*24.9%
div-inv24.9%
associate-*l/43.4%
*-commutative43.4%
Applied egg-rr43.4%
Final simplification32.4%
(FPCore (x y) :precision binary64 (if (<= y 2e+197) (* x (+ (* -0.16666666666666666 (* x x)) 1.0)) (/ (* x y) y)))
double code(double x, double y) {
double tmp;
if (y <= 2e+197) {
tmp = x * ((-0.16666666666666666 * (x * x)) + 1.0);
} else {
tmp = (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 <= 2d+197) then
tmp = x * (((-0.16666666666666666d0) * (x * x)) + 1.0d0)
else
tmp = (x * y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2e+197) {
tmp = x * ((-0.16666666666666666 * (x * x)) + 1.0);
} else {
tmp = (x * y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2e+197: tmp = x * ((-0.16666666666666666 * (x * x)) + 1.0) else: tmp = (x * y) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 2e+197) tmp = Float64(x * Float64(Float64(-0.16666666666666666 * Float64(x * x)) + 1.0)); else tmp = Float64(Float64(x * y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2e+197) tmp = x * ((-0.16666666666666666 * (x * x)) + 1.0); else tmp = (x * y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2e+197], N[(x * N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2 \cdot 10^{+197}:\\
\;\;\;\;x \cdot \left(-0.16666666666666666 \cdot \left(x \cdot x\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{y}\\
\end{array}
\end{array}
if y < 1.9999999999999999e197Initial program 100.0%
Taylor expanded in y around 0 49.5%
Taylor expanded in x around 0 30.2%
*-commutative30.2%
Simplified30.2%
unpow230.2%
Applied egg-rr30.2%
if 1.9999999999999999e197 < y Initial program 100.0%
add-log-exp100.0%
*-un-lft-identity100.0%
log-prod100.0%
metadata-eval100.0%
add-log-exp100.0%
Applied egg-rr100.0%
+-lft-identity100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 2.8%
Taylor expanded in x around 0 29.7%
Final simplification30.2%
(FPCore (x y) :precision binary64 (if (<= x 2e+68) x (/ (* x y) y)))
double code(double x, double y) {
double tmp;
if (x <= 2e+68) {
tmp = x;
} else {
tmp = (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 (x <= 2d+68) then
tmp = x
else
tmp = (x * y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 2e+68) {
tmp = x;
} else {
tmp = (x * y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 2e+68: tmp = x else: tmp = (x * y) / y return tmp
function code(x, y) tmp = 0.0 if (x <= 2e+68) tmp = x; else tmp = Float64(Float64(x * y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 2e+68) tmp = x; else tmp = (x * y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 2e+68], x, N[(N[(x * y), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{+68}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{y}\\
\end{array}
\end{array}
if x < 1.99999999999999991e68Initial program 100.0%
Taylor expanded in x around 0 72.0%
Taylor expanded in y around 0 25.1%
if 1.99999999999999991e68 < x Initial program 99.9%
add-log-exp99.6%
*-un-lft-identity99.6%
log-prod99.6%
metadata-eval99.6%
add-log-exp99.9%
Applied egg-rr99.9%
+-lft-identity99.9%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in y around 0 44.5%
Taylor expanded in x around 0 22.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 x around 0 62.3%
Taylor expanded in y around 0 19.8%
herbie shell --seed 2024185
(FPCore (x y)
:name "Linear.Quaternion:$ccos from linear-1.19.1.3"
:precision binary64
(* (sin x) (/ (sinh y) y)))