
(FPCore (x y) :precision binary64 (/ (* (sin x) (sinh y)) x))
double code(double x, double y) {
return (sin(x) * sinh(y)) / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(x) * sinh(y)) / x
end function
public static double code(double x, double y) {
return (Math.sin(x) * Math.sinh(y)) / x;
}
def code(x, y): return (math.sin(x) * math.sinh(y)) / x
function code(x, y) return Float64(Float64(sin(x) * sinh(y)) / x) end
function tmp = code(x, y) tmp = (sin(x) * sinh(y)) / x; end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x \cdot \sinh y}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* (sin x) (sinh y)) x))
double code(double x, double y) {
return (sin(x) * sinh(y)) / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(x) * sinh(y)) / x
end function
public static double code(double x, double y) {
return (Math.sin(x) * Math.sinh(y)) / x;
}
def code(x, y): return (math.sin(x) * math.sinh(y)) / x
function code(x, y) return Float64(Float64(sin(x) * sinh(y)) / x) end
function tmp = code(x, y) tmp = (sin(x) * sinh(y)) / x; end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x \cdot \sinh y}{x}
\end{array}
(FPCore (x y) :precision binary64 (* (/ (sin x) x) (sinh y)))
double code(double x, double y) {
return (sin(x) / x) * sinh(y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(x) / x) * sinh(y)
end function
public static double code(double x, double y) {
return (Math.sin(x) / x) * Math.sinh(y);
}
def code(x, y): return (math.sin(x) / x) * math.sinh(y)
function code(x, y) return Float64(Float64(sin(x) / x) * sinh(y)) end
function tmp = code(x, y) tmp = (sin(x) / x) * sinh(y); end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x}{x} \cdot \sinh y
\end{array}
Initial program 87.5%
associate-*l/100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(if (<= (sinh y) -2e+34)
(sinh y)
(if (<= (sinh y) 2e-10)
(* (/ (sin x) x) y)
(* (sinh y) (+ 1.0 (* -0.16666666666666666 (* x x)))))))
double code(double x, double y) {
double tmp;
if (sinh(y) <= -2e+34) {
tmp = sinh(y);
} else if (sinh(y) <= 2e-10) {
tmp = (sin(x) / x) * y;
} else {
tmp = sinh(y) * (1.0 + (-0.16666666666666666 * (x * x)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (sinh(y) <= (-2d+34)) then
tmp = sinh(y)
else if (sinh(y) <= 2d-10) then
tmp = (sin(x) / x) * y
else
tmp = sinh(y) * (1.0d0 + ((-0.16666666666666666d0) * (x * x)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (Math.sinh(y) <= -2e+34) {
tmp = Math.sinh(y);
} else if (Math.sinh(y) <= 2e-10) {
tmp = (Math.sin(x) / x) * y;
} else {
tmp = Math.sinh(y) * (1.0 + (-0.16666666666666666 * (x * x)));
}
return tmp;
}
def code(x, y): tmp = 0 if math.sinh(y) <= -2e+34: tmp = math.sinh(y) elif math.sinh(y) <= 2e-10: tmp = (math.sin(x) / x) * y else: tmp = math.sinh(y) * (1.0 + (-0.16666666666666666 * (x * x))) return tmp
function code(x, y) tmp = 0.0 if (sinh(y) <= -2e+34) tmp = sinh(y); elseif (sinh(y) <= 2e-10) tmp = Float64(Float64(sin(x) / x) * y); else tmp = Float64(sinh(y) * Float64(1.0 + Float64(-0.16666666666666666 * Float64(x * x)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (sinh(y) <= -2e+34) tmp = sinh(y); elseif (sinh(y) <= 2e-10) tmp = (sin(x) / x) * y; else tmp = sinh(y) * (1.0 + (-0.16666666666666666 * (x * x))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], -2e+34], N[Sinh[y], $MachinePrecision], If[LessEqual[N[Sinh[y], $MachinePrecision], 2e-10], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[(N[Sinh[y], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -2 \cdot 10^{+34}:\\
\;\;\;\;\sinh y\\
\mathbf{elif}\;\sinh y \leq 2 \cdot 10^{-10}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\sinh y \cdot \left(1 + -0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\
\end{array}
\end{array}
if (sinh.f64 y) < -1.99999999999999989e34Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 90.8%
if -1.99999999999999989e34 < (sinh.f64 y) < 2.00000000000000007e-10Initial program 74.7%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 74.7%
*-commutative74.7%
associate-/l*99.3%
associate-/r/99.9%
Applied egg-rr99.9%
if 2.00000000000000007e-10 < (sinh.f64 y) Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 84.6%
unpow284.6%
Simplified84.6%
Final simplification93.7%
(FPCore (x y)
:precision binary64
(if (<= y -5.6e-18)
(sinh y)
(if (<= y 1.3e-9)
(* (sin x) (/ y x))
(if (<= y 1.26e+163)
(sinh y)
(/
(+ (/ (* (* x x) 0.16666666666666666) y) (/ -1.0 y))
(/ (/ -1.0 y) y))))))
double code(double x, double y) {
double tmp;
if (y <= -5.6e-18) {
tmp = sinh(y);
} else if (y <= 1.3e-9) {
tmp = sin(x) * (y / x);
} else if (y <= 1.26e+163) {
tmp = sinh(y);
} else {
tmp = ((((x * x) * 0.16666666666666666) / y) + (-1.0 / y)) / ((-1.0 / 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 <= (-5.6d-18)) then
tmp = sinh(y)
else if (y <= 1.3d-9) then
tmp = sin(x) * (y / x)
else if (y <= 1.26d+163) then
tmp = sinh(y)
else
tmp = ((((x * x) * 0.16666666666666666d0) / y) + ((-1.0d0) / y)) / (((-1.0d0) / y) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -5.6e-18) {
tmp = Math.sinh(y);
} else if (y <= 1.3e-9) {
tmp = Math.sin(x) * (y / x);
} else if (y <= 1.26e+163) {
tmp = Math.sinh(y);
} else {
tmp = ((((x * x) * 0.16666666666666666) / y) + (-1.0 / y)) / ((-1.0 / y) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -5.6e-18: tmp = math.sinh(y) elif y <= 1.3e-9: tmp = math.sin(x) * (y / x) elif y <= 1.26e+163: tmp = math.sinh(y) else: tmp = ((((x * x) * 0.16666666666666666) / y) + (-1.0 / y)) / ((-1.0 / y) / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -5.6e-18) tmp = sinh(y); elseif (y <= 1.3e-9) tmp = Float64(sin(x) * Float64(y / x)); elseif (y <= 1.26e+163) tmp = sinh(y); else tmp = Float64(Float64(Float64(Float64(Float64(x * x) * 0.16666666666666666) / y) + Float64(-1.0 / y)) / Float64(Float64(-1.0 / y) / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -5.6e-18) tmp = sinh(y); elseif (y <= 1.3e-9) tmp = sin(x) * (y / x); elseif (y <= 1.26e+163) tmp = sinh(y); else tmp = ((((x * x) * 0.16666666666666666) / y) + (-1.0 / y)) / ((-1.0 / y) / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -5.6e-18], N[Sinh[y], $MachinePrecision], If[LessEqual[y, 1.3e-9], N[(N[Sin[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.26e+163], N[Sinh[y], $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] / y), $MachinePrecision] + N[(-1.0 / y), $MachinePrecision]), $MachinePrecision] / N[(N[(-1.0 / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{-18}:\\
\;\;\;\;\sinh y\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-9}:\\
\;\;\;\;\sin x \cdot \frac{y}{x}\\
\mathbf{elif}\;y \leq 1.26 \cdot 10^{+163}:\\
\;\;\;\;\sinh y\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(x \cdot x\right) \cdot 0.16666666666666666}{y} + \frac{-1}{y}}{\frac{\frac{-1}{y}}{y}}\\
\end{array}
\end{array}
if y < -5.60000000000000025e-18 or 1.3000000000000001e-9 < y < 1.26e163Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 85.4%
if -5.60000000000000025e-18 < y < 1.3000000000000001e-9Initial program 74.5%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 74.5%
associate-/l*99.9%
associate-/r/99.8%
Simplified99.8%
if 1.26e163 < y Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 6.4%
associate-/l*6.4%
associate-/r/45.6%
Simplified45.6%
Taylor expanded in x around 0 40.3%
remove-double-div40.3%
associate-/r/40.3%
metadata-eval40.3%
associate-*r*40.3%
distribute-rgt-in40.3%
+-commutative40.3%
unpow240.3%
fma-def40.3%
Simplified40.3%
Applied egg-rr92.9%
associate-*r/92.9%
*-rgt-identity92.9%
associate-*r*92.9%
metadata-eval92.9%
associate-*r/92.9%
*-rgt-identity92.9%
Simplified92.9%
Final simplification93.2%
(FPCore (x y)
:precision binary64
(if (<= y -7.8e-5)
(sinh y)
(if (<= y 1.3e-9)
(* (/ (sin x) x) y)
(if (<= y 1e+162)
(sinh y)
(/
(+ (/ (* (* x x) 0.16666666666666666) y) (/ -1.0 y))
(/ (/ -1.0 y) y))))))
double code(double x, double y) {
double tmp;
if (y <= -7.8e-5) {
tmp = sinh(y);
} else if (y <= 1.3e-9) {
tmp = (sin(x) / x) * y;
} else if (y <= 1e+162) {
tmp = sinh(y);
} else {
tmp = ((((x * x) * 0.16666666666666666) / y) + (-1.0 / y)) / ((-1.0 / 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 <= (-7.8d-5)) then
tmp = sinh(y)
else if (y <= 1.3d-9) then
tmp = (sin(x) / x) * y
else if (y <= 1d+162) then
tmp = sinh(y)
else
tmp = ((((x * x) * 0.16666666666666666d0) / y) + ((-1.0d0) / y)) / (((-1.0d0) / y) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -7.8e-5) {
tmp = Math.sinh(y);
} else if (y <= 1.3e-9) {
tmp = (Math.sin(x) / x) * y;
} else if (y <= 1e+162) {
tmp = Math.sinh(y);
} else {
tmp = ((((x * x) * 0.16666666666666666) / y) + (-1.0 / y)) / ((-1.0 / y) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -7.8e-5: tmp = math.sinh(y) elif y <= 1.3e-9: tmp = (math.sin(x) / x) * y elif y <= 1e+162: tmp = math.sinh(y) else: tmp = ((((x * x) * 0.16666666666666666) / y) + (-1.0 / y)) / ((-1.0 / y) / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -7.8e-5) tmp = sinh(y); elseif (y <= 1.3e-9) tmp = Float64(Float64(sin(x) / x) * y); elseif (y <= 1e+162) tmp = sinh(y); else tmp = Float64(Float64(Float64(Float64(Float64(x * x) * 0.16666666666666666) / y) + Float64(-1.0 / y)) / Float64(Float64(-1.0 / y) / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -7.8e-5) tmp = sinh(y); elseif (y <= 1.3e-9) tmp = (sin(x) / x) * y; elseif (y <= 1e+162) tmp = sinh(y); else tmp = ((((x * x) * 0.16666666666666666) / y) + (-1.0 / y)) / ((-1.0 / y) / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -7.8e-5], N[Sinh[y], $MachinePrecision], If[LessEqual[y, 1.3e-9], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 1e+162], N[Sinh[y], $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] / y), $MachinePrecision] + N[(-1.0 / y), $MachinePrecision]), $MachinePrecision] / N[(N[(-1.0 / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{-5}:\\
\;\;\;\;\sinh y\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-9}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\mathbf{elif}\;y \leq 10^{+162}:\\
\;\;\;\;\sinh y\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(x \cdot x\right) \cdot 0.16666666666666666}{y} + \frac{-1}{y}}{\frac{\frac{-1}{y}}{y}}\\
\end{array}
\end{array}
if y < -7.7999999999999999e-5 or 1.3000000000000001e-9 < y < 9.9999999999999994e161Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 85.3%
if -7.7999999999999999e-5 < y < 1.3000000000000001e-9Initial program 74.7%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 74.7%
*-commutative74.7%
associate-/l*99.3%
associate-/r/99.9%
Applied egg-rr99.9%
if 9.9999999999999994e161 < y Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 6.4%
associate-/l*6.4%
associate-/r/45.6%
Simplified45.6%
Taylor expanded in x around 0 40.3%
remove-double-div40.3%
associate-/r/40.3%
metadata-eval40.3%
associate-*r*40.3%
distribute-rgt-in40.3%
+-commutative40.3%
unpow240.3%
fma-def40.3%
Simplified40.3%
Applied egg-rr92.9%
associate-*r/92.9%
*-rgt-identity92.9%
associate-*r*92.9%
metadata-eval92.9%
associate-*r/92.9%
*-rgt-identity92.9%
Simplified92.9%
Final simplification93.3%
(FPCore (x y)
:precision binary64
(if (<= y -9.8e-83)
(sinh y)
(if (<= y 1.62e-62)
(/ x (/ x y))
(if (<= y 1e+162)
(sinh y)
(/
(+ (/ (* (* x x) 0.16666666666666666) y) (/ -1.0 y))
(/ (/ -1.0 y) y))))))
double code(double x, double y) {
double tmp;
if (y <= -9.8e-83) {
tmp = sinh(y);
} else if (y <= 1.62e-62) {
tmp = x / (x / y);
} else if (y <= 1e+162) {
tmp = sinh(y);
} else {
tmp = ((((x * x) * 0.16666666666666666) / y) + (-1.0 / y)) / ((-1.0 / 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 <= (-9.8d-83)) then
tmp = sinh(y)
else if (y <= 1.62d-62) then
tmp = x / (x / y)
else if (y <= 1d+162) then
tmp = sinh(y)
else
tmp = ((((x * x) * 0.16666666666666666d0) / y) + ((-1.0d0) / y)) / (((-1.0d0) / y) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -9.8e-83) {
tmp = Math.sinh(y);
} else if (y <= 1.62e-62) {
tmp = x / (x / y);
} else if (y <= 1e+162) {
tmp = Math.sinh(y);
} else {
tmp = ((((x * x) * 0.16666666666666666) / y) + (-1.0 / y)) / ((-1.0 / y) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -9.8e-83: tmp = math.sinh(y) elif y <= 1.62e-62: tmp = x / (x / y) elif y <= 1e+162: tmp = math.sinh(y) else: tmp = ((((x * x) * 0.16666666666666666) / y) + (-1.0 / y)) / ((-1.0 / y) / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -9.8e-83) tmp = sinh(y); elseif (y <= 1.62e-62) tmp = Float64(x / Float64(x / y)); elseif (y <= 1e+162) tmp = sinh(y); else tmp = Float64(Float64(Float64(Float64(Float64(x * x) * 0.16666666666666666) / y) + Float64(-1.0 / y)) / Float64(Float64(-1.0 / y) / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -9.8e-83) tmp = sinh(y); elseif (y <= 1.62e-62) tmp = x / (x / y); elseif (y <= 1e+162) tmp = sinh(y); else tmp = ((((x * x) * 0.16666666666666666) / y) + (-1.0 / y)) / ((-1.0 / y) / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -9.8e-83], N[Sinh[y], $MachinePrecision], If[LessEqual[y, 1.62e-62], N[(x / N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+162], N[Sinh[y], $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] / y), $MachinePrecision] + N[(-1.0 / y), $MachinePrecision]), $MachinePrecision] / N[(N[(-1.0 / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.8 \cdot 10^{-83}:\\
\;\;\;\;\sinh y\\
\mathbf{elif}\;y \leq 1.62 \cdot 10^{-62}:\\
\;\;\;\;\frac{x}{\frac{x}{y}}\\
\mathbf{elif}\;y \leq 10^{+162}:\\
\;\;\;\;\sinh y\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(x \cdot x\right) \cdot 0.16666666666666666}{y} + \frac{-1}{y}}{\frac{\frac{-1}{y}}{y}}\\
\end{array}
\end{array}
if y < -9.8e-83 or 1.6199999999999999e-62 < y < 9.9999999999999994e161Initial program 99.2%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 76.9%
if -9.8e-83 < y < 1.6199999999999999e-62Initial program 68.2%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 68.2%
Taylor expanded in x around 0 21.6%
*-commutative21.6%
Simplified21.6%
associate-*l/81.8%
Applied egg-rr81.8%
*-commutative81.8%
clear-num83.0%
un-div-inv83.1%
Applied egg-rr83.1%
if 9.9999999999999994e161 < y Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 6.4%
associate-/l*6.4%
associate-/r/45.6%
Simplified45.6%
Taylor expanded in x around 0 40.3%
remove-double-div40.3%
associate-/r/40.3%
metadata-eval40.3%
associate-*r*40.3%
distribute-rgt-in40.3%
+-commutative40.3%
unpow240.3%
fma-def40.3%
Simplified40.3%
Applied egg-rr92.9%
associate-*r/92.9%
*-rgt-identity92.9%
associate-*r*92.9%
metadata-eval92.9%
associate-*r/92.9%
*-rgt-identity92.9%
Simplified92.9%
Final simplification81.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* -0.16666666666666666 (* x x))))
(if (<= y -3.2e+159)
(+ (* y t_0) (/ (* y y) y))
(if (<= y -3100.0)
(/ (+ (/ x y) (* t_0 (/ x y))) (/ (/ x y) y))
(if (<= y 1.42e-30)
(/ x (/ x y))
(* x (* y (- (* x -0.16666666666666666) (/ -1.0 x)))))))))
double code(double x, double y) {
double t_0 = -0.16666666666666666 * (x * x);
double tmp;
if (y <= -3.2e+159) {
tmp = (y * t_0) + ((y * y) / y);
} else if (y <= -3100.0) {
tmp = ((x / y) + (t_0 * (x / y))) / ((x / y) / y);
} else if (y <= 1.42e-30) {
tmp = x / (x / y);
} else {
tmp = x * (y * ((x * -0.16666666666666666) - (-1.0 / x)));
}
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) * (x * x)
if (y <= (-3.2d+159)) then
tmp = (y * t_0) + ((y * y) / y)
else if (y <= (-3100.0d0)) then
tmp = ((x / y) + (t_0 * (x / y))) / ((x / y) / y)
else if (y <= 1.42d-30) then
tmp = x / (x / y)
else
tmp = x * (y * ((x * (-0.16666666666666666d0)) - ((-1.0d0) / x)))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = -0.16666666666666666 * (x * x);
double tmp;
if (y <= -3.2e+159) {
tmp = (y * t_0) + ((y * y) / y);
} else if (y <= -3100.0) {
tmp = ((x / y) + (t_0 * (x / y))) / ((x / y) / y);
} else if (y <= 1.42e-30) {
tmp = x / (x / y);
} else {
tmp = x * (y * ((x * -0.16666666666666666) - (-1.0 / x)));
}
return tmp;
}
def code(x, y): t_0 = -0.16666666666666666 * (x * x) tmp = 0 if y <= -3.2e+159: tmp = (y * t_0) + ((y * y) / y) elif y <= -3100.0: tmp = ((x / y) + (t_0 * (x / y))) / ((x / y) / y) elif y <= 1.42e-30: tmp = x / (x / y) else: tmp = x * (y * ((x * -0.16666666666666666) - (-1.0 / x))) return tmp
function code(x, y) t_0 = Float64(-0.16666666666666666 * Float64(x * x)) tmp = 0.0 if (y <= -3.2e+159) tmp = Float64(Float64(y * t_0) + Float64(Float64(y * y) / y)); elseif (y <= -3100.0) tmp = Float64(Float64(Float64(x / y) + Float64(t_0 * Float64(x / y))) / Float64(Float64(x / y) / y)); elseif (y <= 1.42e-30) tmp = Float64(x / Float64(x / y)); else tmp = Float64(x * Float64(y * Float64(Float64(x * -0.16666666666666666) - Float64(-1.0 / x)))); end return tmp end
function tmp_2 = code(x, y) t_0 = -0.16666666666666666 * (x * x); tmp = 0.0; if (y <= -3.2e+159) tmp = (y * t_0) + ((y * y) / y); elseif (y <= -3100.0) tmp = ((x / y) + (t_0 * (x / y))) / ((x / y) / y); elseif (y <= 1.42e-30) tmp = x / (x / y); else tmp = x * (y * ((x * -0.16666666666666666) - (-1.0 / x))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.2e+159], N[(N[(y * t$95$0), $MachinePrecision] + N[(N[(y * y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3100.0], N[(N[(N[(x / y), $MachinePrecision] + N[(t$95$0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.42e-30], N[(x / N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(N[(x * -0.16666666666666666), $MachinePrecision] - N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.16666666666666666 \cdot \left(x \cdot x\right)\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+159}:\\
\;\;\;\;y \cdot t_0 + \frac{y \cdot y}{y}\\
\mathbf{elif}\;y \leq -3100:\\
\;\;\;\;\frac{\frac{x}{y} + t_0 \cdot \frac{x}{y}}{\frac{\frac{x}{y}}{y}}\\
\mathbf{elif}\;y \leq 1.42 \cdot 10^{-30}:\\
\;\;\;\;\frac{x}{\frac{x}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(x \cdot -0.16666666666666666 - \frac{-1}{x}\right)\right)\\
\end{array}
\end{array}
if y < -3.19999999999999985e159Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 6.4%
associate-/l*6.4%
associate-/r/54.0%
Simplified54.0%
Taylor expanded in x around 0 8.7%
remove-double-div8.7%
associate-/r/8.7%
metadata-eval8.7%
associate-*r*8.7%
distribute-rgt-in8.7%
+-commutative8.7%
unpow28.7%
fma-def8.7%
Simplified8.7%
fma-udef8.7%
distribute-lft-in8.7%
*-commutative8.7%
cancel-sign-sub8.7%
*-rgt-identity8.7%
remove-double-div8.7%
*-inverses8.7%
associate-/r*8.7%
*-commutative8.7%
un-div-inv8.7%
neg-sub08.7%
flip--83.9%
frac-sub83.9%
Applied egg-rr83.9%
associate-*l/83.9%
*-lft-identity83.9%
sub0-neg83.9%
lft-mult-inverse83.9%
Simplified83.9%
if -3.19999999999999985e159 < y < -3100Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 3.4%
associate-/l*3.4%
associate-/r/9.4%
Simplified9.4%
Taylor expanded in x around 0 12.0%
remove-double-div12.0%
associate-/r/12.0%
metadata-eval12.0%
associate-*r*12.0%
distribute-rgt-in12.0%
+-commutative12.0%
unpow212.0%
fma-def12.0%
Simplified12.0%
fma-udef12.0%
+-commutative12.0%
distribute-lft-in12.0%
*-inverses12.0%
div-inv12.0%
associate-*l*8.9%
div-inv8.9%
*-lft-identity8.9%
*-inverses8.9%
associate-/r/8.6%
associate-*l/8.6%
clear-num8.6%
frac-add26.6%
Applied egg-rr29.7%
associate-*l/29.7%
*-lft-identity29.7%
associate-*l/29.7%
associate-*l/29.7%
metadata-eval29.7%
associate-*r*29.7%
mul-1-neg29.7%
mul-1-neg29.7%
remove-double-neg29.7%
Simplified29.7%
if -3100 < y < 1.42e-30Initial program 73.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 72.3%
Taylor expanded in x around 0 25.1%
*-commutative25.1%
Simplified25.1%
associate-*l/73.9%
Applied egg-rr73.9%
*-commutative73.9%
clear-num74.7%
un-div-inv74.9%
Applied egg-rr74.9%
if 1.42e-30 < y Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 16.0%
associate-/l*16.0%
associate-/r/39.5%
Simplified39.5%
Taylor expanded in x around 0 32.0%
remove-double-div32.0%
associate-/r/32.0%
metadata-eval32.0%
associate-*r*32.0%
distribute-rgt-in32.0%
+-commutative32.0%
unpow232.0%
fma-def32.0%
Simplified32.0%
fma-udef32.0%
+-commutative32.0%
distribute-lft-in32.0%
/-rgt-identity32.0%
associate-*l/32.0%
*-inverses32.0%
div-inv32.0%
associate-*l*12.3%
*-commutative12.3%
associate-/l*12.3%
remove-double-div12.3%
*-inverses12.3%
associate-/r*12.3%
*-commutative12.3%
frac-2neg12.3%
associate-*l/12.3%
frac-add27.7%
Applied egg-rr29.1%
+-commutative29.1%
associate-*l/29.1%
*-lft-identity29.1%
associate-*r*29.1%
metadata-eval29.1%
associate-*r/29.1%
associate-*l/29.1%
metadata-eval29.1%
associate-/r*27.7%
associate-*l/27.7%
*-lft-identity27.7%
Simplified27.7%
Taylor expanded in y around -inf 55.5%
Final simplification65.0%
(FPCore (x y)
:precision binary64
(if (<= y -1.5e+202)
(* x (/ y x))
(if (<= y -8e+75)
(/ (/ x y) (/ (/ x y) y))
(if (<= y 5.1e-30)
(/ x (/ x y))
(* x (* y (- (* x -0.16666666666666666) (/ -1.0 x))))))))
double code(double x, double y) {
double tmp;
if (y <= -1.5e+202) {
tmp = x * (y / x);
} else if (y <= -8e+75) {
tmp = (x / y) / ((x / y) / y);
} else if (y <= 5.1e-30) {
tmp = x / (x / y);
} else {
tmp = x * (y * ((x * -0.16666666666666666) - (-1.0 / x)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.5d+202)) then
tmp = x * (y / x)
else if (y <= (-8d+75)) then
tmp = (x / y) / ((x / y) / y)
else if (y <= 5.1d-30) then
tmp = x / (x / y)
else
tmp = x * (y * ((x * (-0.16666666666666666d0)) - ((-1.0d0) / x)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.5e+202) {
tmp = x * (y / x);
} else if (y <= -8e+75) {
tmp = (x / y) / ((x / y) / y);
} else if (y <= 5.1e-30) {
tmp = x / (x / y);
} else {
tmp = x * (y * ((x * -0.16666666666666666) - (-1.0 / x)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.5e+202: tmp = x * (y / x) elif y <= -8e+75: tmp = (x / y) / ((x / y) / y) elif y <= 5.1e-30: tmp = x / (x / y) else: tmp = x * (y * ((x * -0.16666666666666666) - (-1.0 / x))) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.5e+202) tmp = Float64(x * Float64(y / x)); elseif (y <= -8e+75) tmp = Float64(Float64(x / y) / Float64(Float64(x / y) / y)); elseif (y <= 5.1e-30) tmp = Float64(x / Float64(x / y)); else tmp = Float64(x * Float64(y * Float64(Float64(x * -0.16666666666666666) - Float64(-1.0 / x)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.5e+202) tmp = x * (y / x); elseif (y <= -8e+75) tmp = (x / y) / ((x / y) / y); elseif (y <= 5.1e-30) tmp = x / (x / y); else tmp = x * (y * ((x * -0.16666666666666666) - (-1.0 / x))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.5e+202], N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -8e+75], N[(N[(x / y), $MachinePrecision] / N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.1e-30], N[(x / N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(N[(x * -0.16666666666666666), $MachinePrecision] - N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+202}:\\
\;\;\;\;x \cdot \frac{y}{x}\\
\mathbf{elif}\;y \leq -8 \cdot 10^{+75}:\\
\;\;\;\;\frac{\frac{x}{y}}{\frac{\frac{x}{y}}{y}}\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{-30}:\\
\;\;\;\;\frac{x}{\frac{x}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(x \cdot -0.16666666666666666 - \frac{-1}{x}\right)\right)\\
\end{array}
\end{array}
if y < -1.5000000000000001e202Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 7.4%
Taylor expanded in x around 0 16.5%
*-commutative16.5%
Simplified16.5%
associate-*l/69.1%
Applied egg-rr69.1%
if -1.5000000000000001e202 < y < -7.99999999999999941e75Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 3.9%
associate-/l*3.9%
associate-/r/14.9%
Simplified14.9%
Taylor expanded in x around 0 10.3%
remove-double-div10.3%
associate-/r/10.3%
metadata-eval10.3%
associate-*r*10.3%
distribute-rgt-in10.3%
+-commutative10.3%
unpow210.3%
fma-def10.3%
Simplified10.3%
fma-udef10.3%
+-commutative10.3%
distribute-lft-in10.3%
*-inverses10.3%
div-inv10.3%
associate-*l*6.5%
div-inv6.5%
*-lft-identity6.5%
*-inverses6.5%
associate-/r/6.0%
associate-*l/6.0%
clear-num6.0%
frac-add39.0%
Applied egg-rr42.9%
associate-*l/42.9%
*-lft-identity42.9%
associate-*l/42.9%
associate-*l/42.9%
metadata-eval42.9%
associate-*r*42.9%
mul-1-neg42.9%
mul-1-neg42.9%
remove-double-neg42.9%
Simplified42.9%
Taylor expanded in x around 0 40.2%
if -7.99999999999999941e75 < y < 5.09999999999999972e-30Initial program 76.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 64.3%
Taylor expanded in x around 0 22.6%
*-commutative22.6%
Simplified22.6%
associate-*l/66.3%
Applied egg-rr66.3%
*-commutative66.3%
clear-num67.1%
un-div-inv67.2%
Applied egg-rr67.2%
if 5.09999999999999972e-30 < y Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 16.0%
associate-/l*16.0%
associate-/r/39.5%
Simplified39.5%
Taylor expanded in x around 0 32.0%
remove-double-div32.0%
associate-/r/32.0%
metadata-eval32.0%
associate-*r*32.0%
distribute-rgt-in32.0%
+-commutative32.0%
unpow232.0%
fma-def32.0%
Simplified32.0%
fma-udef32.0%
+-commutative32.0%
distribute-lft-in32.0%
/-rgt-identity32.0%
associate-*l/32.0%
*-inverses32.0%
div-inv32.0%
associate-*l*12.3%
*-commutative12.3%
associate-/l*12.3%
remove-double-div12.3%
*-inverses12.3%
associate-/r*12.3%
*-commutative12.3%
frac-2neg12.3%
associate-*l/12.3%
frac-add27.7%
Applied egg-rr29.1%
+-commutative29.1%
associate-*l/29.1%
*-lft-identity29.1%
associate-*r*29.1%
metadata-eval29.1%
associate-*r/29.1%
associate-*l/29.1%
metadata-eval29.1%
associate-/r*27.7%
associate-*l/27.7%
*-lft-identity27.7%
Simplified27.7%
Taylor expanded in y around -inf 55.5%
Final simplification61.4%
(FPCore (x y)
:precision binary64
(if (<= y -3.4e+132)
(+ (* y (* -0.16666666666666666 (* x x))) (/ (* y y) y))
(if (<= y -9.5e+72)
(/ (/ x y) (/ (/ x y) y))
(if (<= y 4.8e-31)
(/ x (/ x y))
(* x (* y (- (* x -0.16666666666666666) (/ -1.0 x))))))))
double code(double x, double y) {
double tmp;
if (y <= -3.4e+132) {
tmp = (y * (-0.16666666666666666 * (x * x))) + ((y * y) / y);
} else if (y <= -9.5e+72) {
tmp = (x / y) / ((x / y) / y);
} else if (y <= 4.8e-31) {
tmp = x / (x / y);
} else {
tmp = x * (y * ((x * -0.16666666666666666) - (-1.0 / x)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-3.4d+132)) then
tmp = (y * ((-0.16666666666666666d0) * (x * x))) + ((y * y) / y)
else if (y <= (-9.5d+72)) then
tmp = (x / y) / ((x / y) / y)
else if (y <= 4.8d-31) then
tmp = x / (x / y)
else
tmp = x * (y * ((x * (-0.16666666666666666d0)) - ((-1.0d0) / x)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3.4e+132) {
tmp = (y * (-0.16666666666666666 * (x * x))) + ((y * y) / y);
} else if (y <= -9.5e+72) {
tmp = (x / y) / ((x / y) / y);
} else if (y <= 4.8e-31) {
tmp = x / (x / y);
} else {
tmp = x * (y * ((x * -0.16666666666666666) - (-1.0 / x)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3.4e+132: tmp = (y * (-0.16666666666666666 * (x * x))) + ((y * y) / y) elif y <= -9.5e+72: tmp = (x / y) / ((x / y) / y) elif y <= 4.8e-31: tmp = x / (x / y) else: tmp = x * (y * ((x * -0.16666666666666666) - (-1.0 / x))) return tmp
function code(x, y) tmp = 0.0 if (y <= -3.4e+132) tmp = Float64(Float64(y * Float64(-0.16666666666666666 * Float64(x * x))) + Float64(Float64(y * y) / y)); elseif (y <= -9.5e+72) tmp = Float64(Float64(x / y) / Float64(Float64(x / y) / y)); elseif (y <= 4.8e-31) tmp = Float64(x / Float64(x / y)); else tmp = Float64(x * Float64(y * Float64(Float64(x * -0.16666666666666666) - Float64(-1.0 / x)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3.4e+132) tmp = (y * (-0.16666666666666666 * (x * x))) + ((y * y) / y); elseif (y <= -9.5e+72) tmp = (x / y) / ((x / y) / y); elseif (y <= 4.8e-31) tmp = x / (x / y); else tmp = x * (y * ((x * -0.16666666666666666) - (-1.0 / x))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3.4e+132], N[(N[(y * N[(-0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y * y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -9.5e+72], N[(N[(x / y), $MachinePrecision] / N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e-31], N[(x / N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(N[(x * -0.16666666666666666), $MachinePrecision] - N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+132}:\\
\;\;\;\;y \cdot \left(-0.16666666666666666 \cdot \left(x \cdot x\right)\right) + \frac{y \cdot y}{y}\\
\mathbf{elif}\;y \leq -9.5 \cdot 10^{+72}:\\
\;\;\;\;\frac{\frac{x}{y}}{\frac{\frac{x}{y}}{y}}\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-31}:\\
\;\;\;\;\frac{x}{\frac{x}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(x \cdot -0.16666666666666666 - \frac{-1}{x}\right)\right)\\
\end{array}
\end{array}
if y < -3.40000000000000025e132Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 5.9%
associate-/l*5.9%
associate-/r/45.8%
Simplified45.8%
Taylor expanded in x around 0 10.3%
remove-double-div10.3%
associate-/r/10.3%
metadata-eval10.3%
associate-*r*10.3%
distribute-rgt-in10.3%
+-commutative10.3%
unpow210.3%
fma-def10.3%
Simplified10.3%
fma-udef10.3%
distribute-lft-in10.3%
*-commutative10.3%
cancel-sign-sub10.3%
*-rgt-identity10.3%
remove-double-div10.3%
*-inverses10.3%
associate-/r*10.3%
*-commutative10.3%
un-div-inv10.3%
neg-sub010.3%
flip--73.1%
frac-sub73.1%
Applied egg-rr73.1%
associate-*l/73.1%
*-lft-identity73.1%
sub0-neg73.1%
lft-mult-inverse73.1%
Simplified73.1%
if -3.40000000000000025e132 < y < -9.50000000000000054e72Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 3.9%
associate-/l*3.9%
associate-/r/13.5%
Simplified13.5%
Taylor expanded in x around 0 3.3%
remove-double-div3.3%
associate-/r/3.3%
metadata-eval3.3%
associate-*r*3.3%
distribute-rgt-in3.3%
+-commutative3.3%
unpow23.3%
fma-def3.3%
Simplified3.3%
fma-udef3.3%
+-commutative3.3%
distribute-lft-in3.3%
*-inverses3.3%
div-inv3.3%
associate-*l*3.3%
div-inv3.3%
*-lft-identity3.3%
*-inverses3.3%
associate-/r/2.9%
associate-*l/2.9%
clear-num2.9%
frac-add60.4%
Applied egg-rr60.4%
associate-*l/60.4%
*-lft-identity60.4%
associate-*l/60.4%
associate-*l/60.4%
metadata-eval60.4%
associate-*r*60.4%
mul-1-neg60.4%
mul-1-neg60.4%
remove-double-neg60.4%
Simplified60.4%
Taylor expanded in x around 0 61.2%
if -9.50000000000000054e72 < y < 4.8e-31Initial program 76.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 64.3%
Taylor expanded in x around 0 22.6%
*-commutative22.6%
Simplified22.6%
associate-*l/66.3%
Applied egg-rr66.3%
*-commutative66.3%
clear-num67.1%
un-div-inv67.2%
Applied egg-rr67.2%
if 4.8e-31 < y Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 16.0%
associate-/l*16.0%
associate-/r/39.5%
Simplified39.5%
Taylor expanded in x around 0 32.0%
remove-double-div32.0%
associate-/r/32.0%
metadata-eval32.0%
associate-*r*32.0%
distribute-rgt-in32.0%
+-commutative32.0%
unpow232.0%
fma-def32.0%
Simplified32.0%
fma-udef32.0%
+-commutative32.0%
distribute-lft-in32.0%
/-rgt-identity32.0%
associate-*l/32.0%
*-inverses32.0%
div-inv32.0%
associate-*l*12.3%
*-commutative12.3%
associate-/l*12.3%
remove-double-div12.3%
*-inverses12.3%
associate-/r*12.3%
*-commutative12.3%
frac-2neg12.3%
associate-*l/12.3%
frac-add27.7%
Applied egg-rr29.1%
+-commutative29.1%
associate-*l/29.1%
*-lft-identity29.1%
associate-*r*29.1%
metadata-eval29.1%
associate-*r/29.1%
associate-*l/29.1%
metadata-eval29.1%
associate-/r*27.7%
associate-*l/27.7%
*-lft-identity27.7%
Simplified27.7%
Taylor expanded in y around -inf 55.5%
Final simplification64.6%
(FPCore (x y) :precision binary64 (if (<= x 2.15e-29) (* x (/ y x)) (if (<= x 1.35e+57) (/ (/ x y) (/ (/ x y) y)) (/ x (/ x y)))))
double code(double x, double y) {
double tmp;
if (x <= 2.15e-29) {
tmp = x * (y / x);
} else if (x <= 1.35e+57) {
tmp = (x / y) / ((x / y) / y);
} else {
tmp = x / (x / y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 2.15d-29) then
tmp = x * (y / x)
else if (x <= 1.35d+57) then
tmp = (x / y) / ((x / y) / y)
else
tmp = x / (x / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 2.15e-29) {
tmp = x * (y / x);
} else if (x <= 1.35e+57) {
tmp = (x / y) / ((x / y) / y);
} else {
tmp = x / (x / y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 2.15e-29: tmp = x * (y / x) elif x <= 1.35e+57: tmp = (x / y) / ((x / y) / y) else: tmp = x / (x / y) return tmp
function code(x, y) tmp = 0.0 if (x <= 2.15e-29) tmp = Float64(x * Float64(y / x)); elseif (x <= 1.35e+57) tmp = Float64(Float64(x / y) / Float64(Float64(x / y) / y)); else tmp = Float64(x / Float64(x / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 2.15e-29) tmp = x * (y / x); elseif (x <= 1.35e+57) tmp = (x / y) / ((x / y) / y); else tmp = x / (x / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 2.15e-29], N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+57], N[(N[(x / y), $MachinePrecision] / N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x / N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.15 \cdot 10^{-29}:\\
\;\;\;\;x \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+57}:\\
\;\;\;\;\frac{\frac{x}{y}}{\frac{\frac{x}{y}}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{x}{y}}\\
\end{array}
\end{array}
if x < 2.1499999999999999e-29Initial program 83.8%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 35.4%
Taylor expanded in x around 0 20.6%
*-commutative20.6%
Simplified20.6%
associate-*l/58.7%
Applied egg-rr58.7%
if 2.1499999999999999e-29 < x < 1.3499999999999999e57Initial program 99.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 52.0%
associate-/l*52.1%
associate-/r/52.0%
Simplified52.0%
Taylor expanded in x around 0 19.8%
remove-double-div19.8%
associate-/r/19.8%
metadata-eval19.8%
associate-*r*19.8%
distribute-rgt-in19.8%
+-commutative19.8%
unpow219.8%
fma-def19.8%
Simplified19.8%
fma-udef19.8%
+-commutative19.8%
distribute-lft-in19.8%
*-inverses19.8%
div-inv19.8%
associate-*l*19.8%
div-inv19.8%
*-lft-identity19.8%
*-inverses19.8%
associate-/r/19.8%
associate-*l/19.8%
clear-num19.8%
frac-add30.9%
Applied egg-rr25.4%
associate-*l/25.4%
*-lft-identity25.4%
associate-*l/25.4%
associate-*l/25.5%
metadata-eval25.5%
associate-*r*25.5%
mul-1-neg25.5%
mul-1-neg25.5%
remove-double-neg25.5%
Simplified25.5%
Taylor expanded in x around 0 30.2%
if 1.3499999999999999e57 < x Initial program 100.0%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 57.4%
Taylor expanded in x around 0 16.2%
*-commutative16.2%
Simplified16.2%
associate-*l/38.7%
Applied egg-rr38.7%
*-commutative38.7%
clear-num41.7%
un-div-inv41.7%
Applied egg-rr41.7%
Final simplification54.0%
(FPCore (x y) :precision binary64 (* x (/ y x)))
double code(double x, double y) {
return x * (y / x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (y / x)
end function
public static double code(double x, double y) {
return x * (y / x);
}
def code(x, y): return x * (y / x)
function code(x, y) return Float64(x * Float64(y / x)) end
function tmp = code(x, y) tmp = x * (y / x); end
code[x_, y_] := N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y}{x}
\end{array}
Initial program 87.5%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 40.1%
Taylor expanded in x around 0 20.0%
*-commutative20.0%
Simplified20.0%
associate-*l/52.6%
Applied egg-rr52.6%
Final simplification52.6%
(FPCore (x y) :precision binary64 y)
double code(double x, double y) {
return y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = y
end function
public static double code(double x, double y) {
return y;
}
def code(x, y): return y
function code(x, y) return y end
function tmp = code(x, y) tmp = y; end
code[x_, y_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 87.5%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 40.1%
associate-/l*52.5%
associate-/r/65.5%
Simplified65.5%
Taylor expanded in x around 0 28.7%
Final simplification28.7%
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) x)))
double code(double x, double y) {
return sin(x) * (sinh(y) / x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / x)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / x);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / x)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / x)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / x); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{x}
\end{array}
herbie shell --seed 2023297
(FPCore (x y)
:name "Linear.Quaternion:$ccosh from linear-1.19.1.3"
:precision binary64
:herbie-target
(* (sin x) (/ (sinh y) x))
(/ (* (sin x) (sinh y)) x))