
(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 15 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 92.1%
associate-*l/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (<= (sinh y) -0.001) (sinh y) (if (<= (sinh y) 5e-6) (* (sin x) (/ y x)) (sinh y))))
double code(double x, double y) {
double tmp;
if (sinh(y) <= -0.001) {
tmp = sinh(y);
} else if (sinh(y) <= 5e-6) {
tmp = sin(x) * (y / x);
} else {
tmp = sinh(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (sinh(y) <= (-0.001d0)) then
tmp = sinh(y)
else if (sinh(y) <= 5d-6) then
tmp = sin(x) * (y / x)
else
tmp = sinh(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (Math.sinh(y) <= -0.001) {
tmp = Math.sinh(y);
} else if (Math.sinh(y) <= 5e-6) {
tmp = Math.sin(x) * (y / x);
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if math.sinh(y) <= -0.001: tmp = math.sinh(y) elif math.sinh(y) <= 5e-6: tmp = math.sin(x) * (y / x) else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (sinh(y) <= -0.001) tmp = sinh(y); elseif (sinh(y) <= 5e-6) tmp = Float64(sin(x) * Float64(y / x)); else tmp = sinh(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (sinh(y) <= -0.001) tmp = sinh(y); elseif (sinh(y) <= 5e-6) tmp = sin(x) * (y / x); else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], -0.001], N[Sinh[y], $MachinePrecision], If[LessEqual[N[Sinh[y], $MachinePrecision], 5e-6], N[(N[Sin[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -0.001:\\
\;\;\;\;\sinh y\\
\mathbf{elif}\;\sinh y \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\sin x \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (sinh.f64 y) < -1e-3 or 5.00000000000000041e-6 < (sinh.f64 y) Initial program 99.9%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 71.6%
if -1e-3 < (sinh.f64 y) < 5.00000000000000041e-6Initial program 82.5%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 82.0%
associate-/l*99.3%
associate-/r/99.1%
Simplified99.1%
Final simplification84.0%
(FPCore (x y) :precision binary64 (if (<= (sinh y) -0.001) (sinh y) (if (<= (sinh y) 5e-6) (* (/ (sin x) x) y) (sinh y))))
double code(double x, double y) {
double tmp;
if (sinh(y) <= -0.001) {
tmp = sinh(y);
} else if (sinh(y) <= 5e-6) {
tmp = (sin(x) / x) * y;
} else {
tmp = sinh(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (sinh(y) <= (-0.001d0)) then
tmp = sinh(y)
else if (sinh(y) <= 5d-6) then
tmp = (sin(x) / x) * y
else
tmp = sinh(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (Math.sinh(y) <= -0.001) {
tmp = Math.sinh(y);
} else if (Math.sinh(y) <= 5e-6) {
tmp = (Math.sin(x) / x) * y;
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if math.sinh(y) <= -0.001: tmp = math.sinh(y) elif math.sinh(y) <= 5e-6: tmp = (math.sin(x) / x) * y else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (sinh(y) <= -0.001) tmp = sinh(y); elseif (sinh(y) <= 5e-6) tmp = Float64(Float64(sin(x) / x) * y); else tmp = sinh(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (sinh(y) <= -0.001) tmp = sinh(y); elseif (sinh(y) <= 5e-6) tmp = (sin(x) / x) * y; else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], -0.001], N[Sinh[y], $MachinePrecision], If[LessEqual[N[Sinh[y], $MachinePrecision], 5e-6], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -0.001:\\
\;\;\;\;\sinh y\\
\mathbf{elif}\;\sinh y \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (sinh.f64 y) < -1e-3 or 5.00000000000000041e-6 < (sinh.f64 y) Initial program 99.9%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 71.6%
if -1e-3 < (sinh.f64 y) < 5.00000000000000041e-6Initial program 82.5%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in y around 0 99.2%
Final simplification84.0%
(FPCore (x y)
:precision binary64
(if (<= (sinh y) -0.001)
(sinh y)
(if (<= (sinh y) 5e-6)
(/ y (+ 1.0 (* (* x x) 0.16666666666666666)))
(sinh y))))
double code(double x, double y) {
double tmp;
if (sinh(y) <= -0.001) {
tmp = sinh(y);
} else if (sinh(y) <= 5e-6) {
tmp = y / (1.0 + ((x * x) * 0.16666666666666666));
} else {
tmp = sinh(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (sinh(y) <= (-0.001d0)) then
tmp = sinh(y)
else if (sinh(y) <= 5d-6) then
tmp = y / (1.0d0 + ((x * x) * 0.16666666666666666d0))
else
tmp = sinh(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (Math.sinh(y) <= -0.001) {
tmp = Math.sinh(y);
} else if (Math.sinh(y) <= 5e-6) {
tmp = y / (1.0 + ((x * x) * 0.16666666666666666));
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if math.sinh(y) <= -0.001: tmp = math.sinh(y) elif math.sinh(y) <= 5e-6: tmp = y / (1.0 + ((x * x) * 0.16666666666666666)) else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (sinh(y) <= -0.001) tmp = sinh(y); elseif (sinh(y) <= 5e-6) tmp = Float64(y / Float64(1.0 + Float64(Float64(x * x) * 0.16666666666666666))); else tmp = sinh(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (sinh(y) <= -0.001) tmp = sinh(y); elseif (sinh(y) <= 5e-6) tmp = y / (1.0 + ((x * x) * 0.16666666666666666)); else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], -0.001], N[Sinh[y], $MachinePrecision], If[LessEqual[N[Sinh[y], $MachinePrecision], 5e-6], N[(y / N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -0.001:\\
\;\;\;\;\sinh y\\
\mathbf{elif}\;\sinh y \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\frac{y}{1 + \left(x \cdot x\right) \cdot 0.16666666666666666}\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if (sinh.f64 y) < -1e-3 or 5.00000000000000041e-6 < (sinh.f64 y) Initial program 99.9%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 71.6%
if -1e-3 < (sinh.f64 y) < 5.00000000000000041e-6Initial program 82.5%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 82.0%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in x around 0 72.7%
*-commutative72.7%
unpow272.7%
Simplified72.7%
Final simplification72.1%
(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}
Initial program 92.1%
associate-*r/99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (+ 1.0 (* (* x x) -0.16666666666666666)) (sinh y))))
(if (<= y -0.0015)
t_0
(if (<= y 0.0028) (/ y (/ x (sin x))) (if (<= y 2e+100) t_0 (sinh y))))))
double code(double x, double y) {
double t_0 = (1.0 + ((x * x) * -0.16666666666666666)) * sinh(y);
double tmp;
if (y <= -0.0015) {
tmp = t_0;
} else if (y <= 0.0028) {
tmp = y / (x / sin(x));
} else if (y <= 2e+100) {
tmp = t_0;
} else {
tmp = sinh(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 = (1.0d0 + ((x * x) * (-0.16666666666666666d0))) * sinh(y)
if (y <= (-0.0015d0)) then
tmp = t_0
else if (y <= 0.0028d0) then
tmp = y / (x / sin(x))
else if (y <= 2d+100) then
tmp = t_0
else
tmp = sinh(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (1.0 + ((x * x) * -0.16666666666666666)) * Math.sinh(y);
double tmp;
if (y <= -0.0015) {
tmp = t_0;
} else if (y <= 0.0028) {
tmp = y / (x / Math.sin(x));
} else if (y <= 2e+100) {
tmp = t_0;
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): t_0 = (1.0 + ((x * x) * -0.16666666666666666)) * math.sinh(y) tmp = 0 if y <= -0.0015: tmp = t_0 elif y <= 0.0028: tmp = y / (x / math.sin(x)) elif y <= 2e+100: tmp = t_0 else: tmp = math.sinh(y) return tmp
function code(x, y) t_0 = Float64(Float64(1.0 + Float64(Float64(x * x) * -0.16666666666666666)) * sinh(y)) tmp = 0.0 if (y <= -0.0015) tmp = t_0; elseif (y <= 0.0028) tmp = Float64(y / Float64(x / sin(x))); elseif (y <= 2e+100) tmp = t_0; else tmp = sinh(y); end return tmp end
function tmp_2 = code(x, y) t_0 = (1.0 + ((x * x) * -0.16666666666666666)) * sinh(y); tmp = 0.0; if (y <= -0.0015) tmp = t_0; elseif (y <= 0.0028) tmp = y / (x / sin(x)); elseif (y <= 2e+100) tmp = t_0; else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.0015], t$95$0, If[LessEqual[y, 0.0028], N[(y / N[(x / N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+100], t$95$0, N[Sinh[y], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 + \left(x \cdot x\right) \cdot -0.16666666666666666\right) \cdot \sinh y\\
\mathbf{if}\;y \leq -0.0015:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 0.0028:\\
\;\;\;\;\frac{y}{\frac{x}{\sin x}}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+100}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if y < -0.0015 or 0.00279999999999999997 < y < 2.00000000000000003e100Initial program 99.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in x around 0 75.0%
*-commutative75.0%
unpow275.0%
Simplified75.0%
if -0.0015 < y < 0.00279999999999999997Initial program 82.5%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 82.0%
associate-/l*99.3%
Simplified99.3%
if 2.00000000000000003e100 < y Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 82.2%
Final simplification87.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 6.0 (/ y (* x x)))))
(if (<= y -3.5e+17)
t_0
(if (<= y 75.0)
(/ y (+ 1.0 (* (* x x) 0.16666666666666666)))
(if (<= y 2.4e+149) t_0 (sqrt (* y y)))))))
double code(double x, double y) {
double t_0 = 6.0 * (y / (x * x));
double tmp;
if (y <= -3.5e+17) {
tmp = t_0;
} else if (y <= 75.0) {
tmp = y / (1.0 + ((x * x) * 0.16666666666666666));
} else if (y <= 2.4e+149) {
tmp = t_0;
} else {
tmp = sqrt((y * 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 = 6.0d0 * (y / (x * x))
if (y <= (-3.5d+17)) then
tmp = t_0
else if (y <= 75.0d0) then
tmp = y / (1.0d0 + ((x * x) * 0.16666666666666666d0))
else if (y <= 2.4d+149) then
tmp = t_0
else
tmp = sqrt((y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 6.0 * (y / (x * x));
double tmp;
if (y <= -3.5e+17) {
tmp = t_0;
} else if (y <= 75.0) {
tmp = y / (1.0 + ((x * x) * 0.16666666666666666));
} else if (y <= 2.4e+149) {
tmp = t_0;
} else {
tmp = Math.sqrt((y * y));
}
return tmp;
}
def code(x, y): t_0 = 6.0 * (y / (x * x)) tmp = 0 if y <= -3.5e+17: tmp = t_0 elif y <= 75.0: tmp = y / (1.0 + ((x * x) * 0.16666666666666666)) elif y <= 2.4e+149: tmp = t_0 else: tmp = math.sqrt((y * y)) return tmp
function code(x, y) t_0 = Float64(6.0 * Float64(y / Float64(x * x))) tmp = 0.0 if (y <= -3.5e+17) tmp = t_0; elseif (y <= 75.0) tmp = Float64(y / Float64(1.0 + Float64(Float64(x * x) * 0.16666666666666666))); elseif (y <= 2.4e+149) tmp = t_0; else tmp = sqrt(Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) t_0 = 6.0 * (y / (x * x)); tmp = 0.0; if (y <= -3.5e+17) tmp = t_0; elseif (y <= 75.0) tmp = y / (1.0 + ((x * x) * 0.16666666666666666)); elseif (y <= 2.4e+149) tmp = t_0; else tmp = sqrt((y * y)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(6.0 * N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.5e+17], t$95$0, If[LessEqual[y, 75.0], N[(y / N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e+149], t$95$0, N[Sqrt[N[(y * y), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{+17}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 75:\\
\;\;\;\;\frac{y}{1 + \left(x \cdot x\right) \cdot 0.16666666666666666}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+149}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y \cdot y}\\
\end{array}
\end{array}
if y < -3.5e17 or 75 < y < 2.40000000000000012e149Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 3.9%
associate-/l*3.9%
Simplified3.9%
Taylor expanded in x around 0 3.0%
*-commutative3.0%
unpow23.0%
Simplified3.0%
Taylor expanded in x around inf 30.5%
unpow230.5%
Simplified30.5%
if -3.5e17 < y < 75Initial program 83.6%
associate-*r/98.9%
Simplified98.9%
Taylor expanded in y around 0 77.9%
associate-/l*94.1%
Simplified94.1%
Taylor expanded in x around 0 69.0%
*-commutative69.0%
unpow269.0%
Simplified69.0%
if 2.40000000000000012e149 < y Initial program 100.0%
Taylor expanded in y around 0 5.2%
Taylor expanded in x around 0 35.1%
*-commutative35.1%
Simplified35.1%
associate-/l*5.7%
*-inverses5.7%
/-rgt-identity5.7%
add-sqr-sqrt5.7%
sqrt-unprod80.1%
Applied egg-rr80.1%
Final simplification55.8%
(FPCore (x y) :precision binary64 (if (<= y -0.00155) (sinh y) (if (<= y 0.00045) (/ y (/ x (sin x))) (sinh y))))
double code(double x, double y) {
double tmp;
if (y <= -0.00155) {
tmp = sinh(y);
} else if (y <= 0.00045) {
tmp = y / (x / sin(x));
} else {
tmp = sinh(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.00155d0)) then
tmp = sinh(y)
else if (y <= 0.00045d0) then
tmp = y / (x / sin(x))
else
tmp = sinh(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -0.00155) {
tmp = Math.sinh(y);
} else if (y <= 0.00045) {
tmp = y / (x / Math.sin(x));
} else {
tmp = Math.sinh(y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -0.00155: tmp = math.sinh(y) elif y <= 0.00045: tmp = y / (x / math.sin(x)) else: tmp = math.sinh(y) return tmp
function code(x, y) tmp = 0.0 if (y <= -0.00155) tmp = sinh(y); elseif (y <= 0.00045) tmp = Float64(y / Float64(x / sin(x))); else tmp = sinh(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -0.00155) tmp = sinh(y); elseif (y <= 0.00045) tmp = y / (x / sin(x)); else tmp = sinh(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -0.00155], N[Sinh[y], $MachinePrecision], If[LessEqual[y, 0.00045], N[(y / N[(x / N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00155:\\
\;\;\;\;\sinh y\\
\mathbf{elif}\;y \leq 0.00045:\\
\;\;\;\;\frac{y}{\frac{x}{\sin x}}\\
\mathbf{else}:\\
\;\;\;\;\sinh y\\
\end{array}
\end{array}
if y < -0.00154999999999999995 or 4.4999999999999999e-4 < y Initial program 99.9%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 71.6%
if -0.00154999999999999995 < y < 4.4999999999999999e-4Initial program 82.5%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 82.0%
associate-/l*99.3%
Simplified99.3%
Final simplification84.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (/ y x))) (t_1 (+ y (* y (* x (* x -0.16666666666666666))))))
(if (<= x 1e+108)
t_0
(if (<= x 5.3e+216)
t_1
(if (<= x 9.5e+238) (/ (* x y) x) (if (<= x 5.2e+269) t_1 t_0))))))
double code(double x, double y) {
double t_0 = x * (y / x);
double t_1 = y + (y * (x * (x * -0.16666666666666666)));
double tmp;
if (x <= 1e+108) {
tmp = t_0;
} else if (x <= 5.3e+216) {
tmp = t_1;
} else if (x <= 9.5e+238) {
tmp = (x * y) / x;
} else if (x <= 5.2e+269) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x * (y / x)
t_1 = y + (y * (x * (x * (-0.16666666666666666d0))))
if (x <= 1d+108) then
tmp = t_0
else if (x <= 5.3d+216) then
tmp = t_1
else if (x <= 9.5d+238) then
tmp = (x * y) / x
else if (x <= 5.2d+269) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x * (y / x);
double t_1 = y + (y * (x * (x * -0.16666666666666666)));
double tmp;
if (x <= 1e+108) {
tmp = t_0;
} else if (x <= 5.3e+216) {
tmp = t_1;
} else if (x <= 9.5e+238) {
tmp = (x * y) / x;
} else if (x <= 5.2e+269) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x * (y / x) t_1 = y + (y * (x * (x * -0.16666666666666666))) tmp = 0 if x <= 1e+108: tmp = t_0 elif x <= 5.3e+216: tmp = t_1 elif x <= 9.5e+238: tmp = (x * y) / x elif x <= 5.2e+269: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x * Float64(y / x)) t_1 = Float64(y + Float64(y * Float64(x * Float64(x * -0.16666666666666666)))) tmp = 0.0 if (x <= 1e+108) tmp = t_0; elseif (x <= 5.3e+216) tmp = t_1; elseif (x <= 9.5e+238) tmp = Float64(Float64(x * y) / x); elseif (x <= 5.2e+269) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x * (y / x); t_1 = y + (y * (x * (x * -0.16666666666666666))); tmp = 0.0; if (x <= 1e+108) tmp = t_0; elseif (x <= 5.3e+216) tmp = t_1; elseif (x <= 9.5e+238) tmp = (x * y) / x; elseif (x <= 5.2e+269) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y + N[(y * N[(x * N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1e+108], t$95$0, If[LessEqual[x, 5.3e+216], t$95$1, If[LessEqual[x, 9.5e+238], N[(N[(x * y), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 5.2e+269], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{y}{x}\\
t_1 := y + y \cdot \left(x \cdot \left(x \cdot -0.16666666666666666\right)\right)\\
\mathbf{if}\;x \leq 10^{+108}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 5.3 \cdot 10^{+216}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+238}:\\
\;\;\;\;\frac{x \cdot y}{x}\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+269}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < 1e108 or 5.2e269 < x Initial program 90.9%
Taylor expanded in y around 0 40.7%
Taylor expanded in x around 0 25.0%
*-commutative25.0%
Simplified25.0%
associate-/l*26.7%
associate-/r/48.7%
Applied egg-rr48.7%
if 1e108 < x < 5.30000000000000002e216 or 9.5000000000000003e238 < x < 5.2e269Initial program 99.8%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 35.7%
associate-/l*35.7%
Simplified35.7%
Taylor expanded in x around 0 41.2%
associate-*r*41.2%
*-commutative41.2%
unpow241.2%
associate-*r*41.2%
Simplified41.2%
if 5.30000000000000002e216 < x < 9.5000000000000003e238Initial program 100.0%
Taylor expanded in y around 0 2.9%
Taylor expanded in x around 0 67.9%
*-commutative67.9%
Simplified67.9%
Final simplification48.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (/ y x))))
(if (<= x 1.1e+108)
t_0
(if (<= x 5.3e+216)
(+ y (* (* x -0.16666666666666666) (* x y)))
(if (<= x 9.5e+238)
(/ (* x y) x)
(if (<= x 1.32e+270)
(+ y (* y (* x (* x -0.16666666666666666))))
t_0))))))
double code(double x, double y) {
double t_0 = x * (y / x);
double tmp;
if (x <= 1.1e+108) {
tmp = t_0;
} else if (x <= 5.3e+216) {
tmp = y + ((x * -0.16666666666666666) * (x * y));
} else if (x <= 9.5e+238) {
tmp = (x * y) / x;
} else if (x <= 1.32e+270) {
tmp = y + (y * (x * (x * -0.16666666666666666)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x * (y / x)
if (x <= 1.1d+108) then
tmp = t_0
else if (x <= 5.3d+216) then
tmp = y + ((x * (-0.16666666666666666d0)) * (x * y))
else if (x <= 9.5d+238) then
tmp = (x * y) / x
else if (x <= 1.32d+270) then
tmp = y + (y * (x * (x * (-0.16666666666666666d0))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x * (y / x);
double tmp;
if (x <= 1.1e+108) {
tmp = t_0;
} else if (x <= 5.3e+216) {
tmp = y + ((x * -0.16666666666666666) * (x * y));
} else if (x <= 9.5e+238) {
tmp = (x * y) / x;
} else if (x <= 1.32e+270) {
tmp = y + (y * (x * (x * -0.16666666666666666)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x * (y / x) tmp = 0 if x <= 1.1e+108: tmp = t_0 elif x <= 5.3e+216: tmp = y + ((x * -0.16666666666666666) * (x * y)) elif x <= 9.5e+238: tmp = (x * y) / x elif x <= 1.32e+270: tmp = y + (y * (x * (x * -0.16666666666666666))) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x * Float64(y / x)) tmp = 0.0 if (x <= 1.1e+108) tmp = t_0; elseif (x <= 5.3e+216) tmp = Float64(y + Float64(Float64(x * -0.16666666666666666) * Float64(x * y))); elseif (x <= 9.5e+238) tmp = Float64(Float64(x * y) / x); elseif (x <= 1.32e+270) tmp = Float64(y + Float64(y * Float64(x * Float64(x * -0.16666666666666666)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x * (y / x); tmp = 0.0; if (x <= 1.1e+108) tmp = t_0; elseif (x <= 5.3e+216) tmp = y + ((x * -0.16666666666666666) * (x * y)); elseif (x <= 9.5e+238) tmp = (x * y) / x; elseif (x <= 1.32e+270) tmp = y + (y * (x * (x * -0.16666666666666666))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.1e+108], t$95$0, If[LessEqual[x, 5.3e+216], N[(y + N[(N[(x * -0.16666666666666666), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e+238], N[(N[(x * y), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 1.32e+270], N[(y + N[(y * N[(x * N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{y}{x}\\
\mathbf{if}\;x \leq 1.1 \cdot 10^{+108}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 5.3 \cdot 10^{+216}:\\
\;\;\;\;y + \left(x \cdot -0.16666666666666666\right) \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+238}:\\
\;\;\;\;\frac{x \cdot y}{x}\\
\mathbf{elif}\;x \leq 1.32 \cdot 10^{+270}:\\
\;\;\;\;y + y \cdot \left(x \cdot \left(x \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < 1.1000000000000001e108 or 1.31999999999999992e270 < x Initial program 90.9%
Taylor expanded in y around 0 40.7%
Taylor expanded in x around 0 25.0%
*-commutative25.0%
Simplified25.0%
associate-/l*26.7%
associate-/r/48.7%
Applied egg-rr48.7%
if 1.1000000000000001e108 < x < 5.30000000000000002e216Initial program 99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in y around 0 44.9%
associate-/l*45.0%
Simplified45.0%
Taylor expanded in x around 0 36.8%
+-commutative36.8%
fma-def36.8%
unpow236.8%
associate-*l*36.9%
*-commutative36.9%
Simplified36.9%
fma-udef36.9%
associate-*r*36.9%
*-commutative36.9%
*-commutative36.9%
Applied egg-rr36.9%
if 5.30000000000000002e216 < x < 9.5000000000000003e238Initial program 100.0%
Taylor expanded in y around 0 2.9%
Taylor expanded in x around 0 67.9%
*-commutative67.9%
Simplified67.9%
if 9.5000000000000003e238 < x < 1.31999999999999992e270Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 2.5%
associate-/l*2.5%
Simplified2.5%
Taylor expanded in x around 0 57.1%
associate-*r*57.1%
*-commutative57.1%
unpow257.1%
associate-*r*57.1%
Simplified57.1%
Final simplification48.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 6.0 (/ y (* x x)))) (t_1 (* x (/ y x))))
(if (<= y -13.0)
t_0
(if (<= y 75.0)
t_1
(if (<= y 1.3e+149) t_0 (if (<= y 6.4e+272) (/ (* x y) x) t_1))))))
double code(double x, double y) {
double t_0 = 6.0 * (y / (x * x));
double t_1 = x * (y / x);
double tmp;
if (y <= -13.0) {
tmp = t_0;
} else if (y <= 75.0) {
tmp = t_1;
} else if (y <= 1.3e+149) {
tmp = t_0;
} else if (y <= 6.4e+272) {
tmp = (x * y) / x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 6.0d0 * (y / (x * x))
t_1 = x * (y / x)
if (y <= (-13.0d0)) then
tmp = t_0
else if (y <= 75.0d0) then
tmp = t_1
else if (y <= 1.3d+149) then
tmp = t_0
else if (y <= 6.4d+272) then
tmp = (x * y) / x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 6.0 * (y / (x * x));
double t_1 = x * (y / x);
double tmp;
if (y <= -13.0) {
tmp = t_0;
} else if (y <= 75.0) {
tmp = t_1;
} else if (y <= 1.3e+149) {
tmp = t_0;
} else if (y <= 6.4e+272) {
tmp = (x * y) / x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y): t_0 = 6.0 * (y / (x * x)) t_1 = x * (y / x) tmp = 0 if y <= -13.0: tmp = t_0 elif y <= 75.0: tmp = t_1 elif y <= 1.3e+149: tmp = t_0 elif y <= 6.4e+272: tmp = (x * y) / x else: tmp = t_1 return tmp
function code(x, y) t_0 = Float64(6.0 * Float64(y / Float64(x * x))) t_1 = Float64(x * Float64(y / x)) tmp = 0.0 if (y <= -13.0) tmp = t_0; elseif (y <= 75.0) tmp = t_1; elseif (y <= 1.3e+149) tmp = t_0; elseif (y <= 6.4e+272) tmp = Float64(Float64(x * y) / x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y) t_0 = 6.0 * (y / (x * x)); t_1 = x * (y / x); tmp = 0.0; if (y <= -13.0) tmp = t_0; elseif (y <= 75.0) tmp = t_1; elseif (y <= 1.3e+149) tmp = t_0; elseif (y <= 6.4e+272) tmp = (x * y) / x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(6.0 * N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -13.0], t$95$0, If[LessEqual[y, 75.0], t$95$1, If[LessEqual[y, 1.3e+149], t$95$0, If[LessEqual[y, 6.4e+272], N[(N[(x * y), $MachinePrecision] / x), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \frac{y}{x \cdot x}\\
t_1 := x \cdot \frac{y}{x}\\
\mathbf{if}\;y \leq -13:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 75:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+149}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{+272}:\\
\;\;\;\;\frac{x \cdot y}{x}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -13 or 75 < y < 1.29999999999999989e149Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 3.9%
associate-/l*3.9%
Simplified3.9%
Taylor expanded in x around 0 3.0%
*-commutative3.0%
unpow23.0%
Simplified3.0%
Taylor expanded in x around inf 30.0%
unpow230.0%
Simplified30.0%
if -13 < y < 75 or 6.3999999999999997e272 < y Initial program 84.2%
Taylor expanded in y around 0 75.3%
Taylor expanded in x around 0 28.6%
*-commutative28.6%
Simplified28.6%
associate-/l*43.4%
associate-/r/68.7%
Applied egg-rr68.7%
if 1.29999999999999989e149 < y < 6.3999999999999997e272Initial program 100.0%
Taylor expanded in y around 0 4.2%
Taylor expanded in x around 0 38.1%
*-commutative38.1%
Simplified38.1%
Final simplification50.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 6.0 (/ y (* x x)))))
(if (<= y -3.5e+17)
t_0
(if (<= y 75.0)
(/ y (+ 1.0 (* (* x x) 0.16666666666666666)))
(if (<= y 2.4e+149)
t_0
(if (<= y 5.5e+272) (/ (* x y) x) (* x (/ y x))))))))
double code(double x, double y) {
double t_0 = 6.0 * (y / (x * x));
double tmp;
if (y <= -3.5e+17) {
tmp = t_0;
} else if (y <= 75.0) {
tmp = y / (1.0 + ((x * x) * 0.16666666666666666));
} else if (y <= 2.4e+149) {
tmp = t_0;
} else if (y <= 5.5e+272) {
tmp = (x * y) / x;
} else {
tmp = x * (y / 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 = 6.0d0 * (y / (x * x))
if (y <= (-3.5d+17)) then
tmp = t_0
else if (y <= 75.0d0) then
tmp = y / (1.0d0 + ((x * x) * 0.16666666666666666d0))
else if (y <= 2.4d+149) then
tmp = t_0
else if (y <= 5.5d+272) then
tmp = (x * y) / x
else
tmp = x * (y / x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 6.0 * (y / (x * x));
double tmp;
if (y <= -3.5e+17) {
tmp = t_0;
} else if (y <= 75.0) {
tmp = y / (1.0 + ((x * x) * 0.16666666666666666));
} else if (y <= 2.4e+149) {
tmp = t_0;
} else if (y <= 5.5e+272) {
tmp = (x * y) / x;
} else {
tmp = x * (y / x);
}
return tmp;
}
def code(x, y): t_0 = 6.0 * (y / (x * x)) tmp = 0 if y <= -3.5e+17: tmp = t_0 elif y <= 75.0: tmp = y / (1.0 + ((x * x) * 0.16666666666666666)) elif y <= 2.4e+149: tmp = t_0 elif y <= 5.5e+272: tmp = (x * y) / x else: tmp = x * (y / x) return tmp
function code(x, y) t_0 = Float64(6.0 * Float64(y / Float64(x * x))) tmp = 0.0 if (y <= -3.5e+17) tmp = t_0; elseif (y <= 75.0) tmp = Float64(y / Float64(1.0 + Float64(Float64(x * x) * 0.16666666666666666))); elseif (y <= 2.4e+149) tmp = t_0; elseif (y <= 5.5e+272) tmp = Float64(Float64(x * y) / x); else tmp = Float64(x * Float64(y / x)); end return tmp end
function tmp_2 = code(x, y) t_0 = 6.0 * (y / (x * x)); tmp = 0.0; if (y <= -3.5e+17) tmp = t_0; elseif (y <= 75.0) tmp = y / (1.0 + ((x * x) * 0.16666666666666666)); elseif (y <= 2.4e+149) tmp = t_0; elseif (y <= 5.5e+272) tmp = (x * y) / x; else tmp = x * (y / x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(6.0 * N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.5e+17], t$95$0, If[LessEqual[y, 75.0], N[(y / N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e+149], t$95$0, If[LessEqual[y, 5.5e+272], N[(N[(x * y), $MachinePrecision] / x), $MachinePrecision], N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{+17}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 75:\\
\;\;\;\;\frac{y}{1 + \left(x \cdot x\right) \cdot 0.16666666666666666}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+149}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+272}:\\
\;\;\;\;\frac{x \cdot y}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{x}\\
\end{array}
\end{array}
if y < -3.5e17 or 75 < y < 2.40000000000000012e149Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 3.9%
associate-/l*3.9%
Simplified3.9%
Taylor expanded in x around 0 3.0%
*-commutative3.0%
unpow23.0%
Simplified3.0%
Taylor expanded in x around inf 30.5%
unpow230.5%
Simplified30.5%
if -3.5e17 < y < 75Initial program 83.6%
associate-*r/98.9%
Simplified98.9%
Taylor expanded in y around 0 77.9%
associate-/l*94.1%
Simplified94.1%
Taylor expanded in x around 0 69.0%
*-commutative69.0%
unpow269.0%
Simplified69.0%
if 2.40000000000000012e149 < y < 5.4999999999999998e272Initial program 100.0%
Taylor expanded in y around 0 4.2%
Taylor expanded in x around 0 38.1%
*-commutative38.1%
Simplified38.1%
if 5.4999999999999998e272 < y Initial program 100.0%
Taylor expanded in y around 0 9.4%
Taylor expanded in x around 0 23.0%
*-commutative23.0%
Simplified23.0%
associate-/l*10.0%
associate-/r/87.0%
Applied egg-rr87.0%
Final simplification51.4%
(FPCore (x y) :precision binary64 (if (or (<= x 1.65e+122) (not (<= x 2e+288))) (* x (/ y x)) (/ (* x y) x)))
double code(double x, double y) {
double tmp;
if ((x <= 1.65e+122) || !(x <= 2e+288)) {
tmp = x * (y / x);
} else {
tmp = (x * y) / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= 1.65d+122) .or. (.not. (x <= 2d+288))) then
tmp = x * (y / x)
else
tmp = (x * y) / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= 1.65e+122) || !(x <= 2e+288)) {
tmp = x * (y / x);
} else {
tmp = (x * y) / x;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= 1.65e+122) or not (x <= 2e+288): tmp = x * (y / x) else: tmp = (x * y) / x return tmp
function code(x, y) tmp = 0.0 if ((x <= 1.65e+122) || !(x <= 2e+288)) tmp = Float64(x * Float64(y / x)); else tmp = Float64(Float64(x * y) / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= 1.65e+122) || ~((x <= 2e+288))) tmp = x * (y / x); else tmp = (x * y) / x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, 1.65e+122], N[Not[LessEqual[x, 2e+288]], $MachinePrecision]], N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.65 \cdot 10^{+122} \lor \neg \left(x \leq 2 \cdot 10^{+288}\right):\\
\;\;\;\;x \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{x}\\
\end{array}
\end{array}
if x < 1.6499999999999999e122 or 2e288 < x Initial program 91.0%
Taylor expanded in y around 0 40.7%
Taylor expanded in x around 0 23.9%
*-commutative23.9%
Simplified23.9%
associate-/l*26.5%
associate-/r/47.8%
Applied egg-rr47.8%
if 1.6499999999999999e122 < x < 2e288Initial program 99.9%
Taylor expanded in y around 0 32.3%
Taylor expanded in x around 0 29.1%
*-commutative29.1%
Simplified29.1%
Final simplification45.4%
(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 92.1%
Taylor expanded in y around 0 39.6%
Taylor expanded in x around 0 24.6%
*-commutative24.6%
Simplified24.6%
associate-/l*23.5%
associate-/r/43.9%
Applied egg-rr43.9%
Final simplification43.9%
(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 92.1%
associate-*r/99.5%
Simplified99.5%
Taylor expanded in y around 0 39.6%
associate-/l*47.4%
Simplified47.4%
Taylor expanded in x around 0 23.5%
Final simplification23.5%
(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 2023293
(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))