
(FPCore (x y) :precision binary64 (* (cosh x) (/ (sin y) y)))
double code(double x, double y) {
return cosh(x) * (sin(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cosh(x) * (sin(y) / y)
end function
public static double code(double x, double y) {
return Math.cosh(x) * (Math.sin(y) / y);
}
def code(x, y): return math.cosh(x) * (math.sin(y) / y)
function code(x, y) return Float64(cosh(x) * Float64(sin(y) / y)) end
function tmp = code(x, y) tmp = cosh(x) * (sin(y) / y); end
code[x_, y_] := N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cosh x \cdot \frac{\sin y}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (* (cosh x) (/ (sin y) y)))
double code(double x, double y) {
return cosh(x) * (sin(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cosh(x) * (sin(y) / y)
end function
public static double code(double x, double y) {
return Math.cosh(x) * (Math.sin(y) / y);
}
def code(x, y): return math.cosh(x) * (math.sin(y) / y)
function code(x, y) return Float64(cosh(x) * Float64(sin(y) / y)) end
function tmp = code(x, y) tmp = cosh(x) * (sin(y) / y); end
code[x_, y_] := N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cosh x \cdot \frac{\sin y}{y}
\end{array}
(FPCore (x y) :precision binary64 (/ (* (sin y) (cosh x)) y))
double code(double x, double y) {
return (sin(y) * cosh(x)) / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(y) * cosh(x)) / y
end function
public static double code(double x, double y) {
return (Math.sin(y) * Math.cosh(x)) / y;
}
def code(x, y): return (math.sin(y) * math.cosh(x)) / y
function code(x, y) return Float64(Float64(sin(y) * cosh(x)) / y) end
function tmp = code(x, y) tmp = (sin(y) * cosh(x)) / y; end
code[x_, y_] := N[(N[(N[Sin[y], $MachinePrecision] * N[Cosh[x], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin y \cdot \cosh x}{y}
\end{array}
Initial program 99.9%
*-commutative99.9%
associate-*l/99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (<= (cosh x) 10.0) (/ (sin y) y) (cosh x)))
double code(double x, double y) {
double tmp;
if (cosh(x) <= 10.0) {
tmp = sin(y) / y;
} else {
tmp = cosh(x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (cosh(x) <= 10.0d0) then
tmp = sin(y) / y
else
tmp = cosh(x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (Math.cosh(x) <= 10.0) {
tmp = Math.sin(y) / y;
} else {
tmp = Math.cosh(x);
}
return tmp;
}
def code(x, y): tmp = 0 if math.cosh(x) <= 10.0: tmp = math.sin(y) / y else: tmp = math.cosh(x) return tmp
function code(x, y) tmp = 0.0 if (cosh(x) <= 10.0) tmp = Float64(sin(y) / y); else tmp = cosh(x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (cosh(x) <= 10.0) tmp = sin(y) / y; else tmp = cosh(x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Cosh[x], $MachinePrecision], 10.0], N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision], N[Cosh[x], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cosh x \leq 10:\\
\;\;\;\;\frac{\sin y}{y}\\
\mathbf{else}:\\
\;\;\;\;\cosh x\\
\end{array}
\end{array}
if (cosh.f64 x) < 10Initial program 99.7%
Taylor expanded in x around 0 98.4%
if 10 < (cosh.f64 x) Initial program 100.0%
Taylor expanded in y around 0 77.4%
Final simplification87.9%
(FPCore (x y) :precision binary64 (* (/ (sin y) y) (cosh x)))
double code(double x, double y) {
return (sin(y) / y) * cosh(x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(y) / y) * cosh(x)
end function
public static double code(double x, double y) {
return (Math.sin(y) / y) * Math.cosh(x);
}
def code(x, y): return (math.sin(y) / y) * math.cosh(x)
function code(x, y) return Float64(Float64(sin(y) / y) * cosh(x)) end
function tmp = code(x, y) tmp = (sin(y) / y) * cosh(x); end
code[x_, y_] := N[(N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision] * N[Cosh[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin y}{y} \cdot \cosh x
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.5 (/ (sin y) (/ y (* x x))))))
(if (<= x -1.35e+154)
t_0
(if (<= x -92000000.0)
(cosh x)
(if (<= x 0.37) (/ (sin y) y) (if (<= x 3.2e+107) (cosh x) t_0))))))
double code(double x, double y) {
double t_0 = 0.5 * (sin(y) / (y / (x * x)));
double tmp;
if (x <= -1.35e+154) {
tmp = t_0;
} else if (x <= -92000000.0) {
tmp = cosh(x);
} else if (x <= 0.37) {
tmp = sin(y) / y;
} else if (x <= 3.2e+107) {
tmp = cosh(x);
} 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 = 0.5d0 * (sin(y) / (y / (x * x)))
if (x <= (-1.35d+154)) then
tmp = t_0
else if (x <= (-92000000.0d0)) then
tmp = cosh(x)
else if (x <= 0.37d0) then
tmp = sin(y) / y
else if (x <= 3.2d+107) then
tmp = cosh(x)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.5 * (Math.sin(y) / (y / (x * x)));
double tmp;
if (x <= -1.35e+154) {
tmp = t_0;
} else if (x <= -92000000.0) {
tmp = Math.cosh(x);
} else if (x <= 0.37) {
tmp = Math.sin(y) / y;
} else if (x <= 3.2e+107) {
tmp = Math.cosh(x);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.5 * (math.sin(y) / (y / (x * x))) tmp = 0 if x <= -1.35e+154: tmp = t_0 elif x <= -92000000.0: tmp = math.cosh(x) elif x <= 0.37: tmp = math.sin(y) / y elif x <= 3.2e+107: tmp = math.cosh(x) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.5 * Float64(sin(y) / Float64(y / Float64(x * x)))) tmp = 0.0 if (x <= -1.35e+154) tmp = t_0; elseif (x <= -92000000.0) tmp = cosh(x); elseif (x <= 0.37) tmp = Float64(sin(y) / y); elseif (x <= 3.2e+107) tmp = cosh(x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.5 * (sin(y) / (y / (x * x))); tmp = 0.0; if (x <= -1.35e+154) tmp = t_0; elseif (x <= -92000000.0) tmp = cosh(x); elseif (x <= 0.37) tmp = sin(y) / y; elseif (x <= 3.2e+107) tmp = cosh(x); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.5 * N[(N[Sin[y], $MachinePrecision] / N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e+154], t$95$0, If[LessEqual[x, -92000000.0], N[Cosh[x], $MachinePrecision], If[LessEqual[x, 0.37], N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, 3.2e+107], N[Cosh[x], $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \frac{\sin y}{\frac{y}{x \cdot x}}\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -92000000:\\
\;\;\;\;\cosh x\\
\mathbf{elif}\;x \leq 0.37:\\
\;\;\;\;\frac{\sin y}{y}\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+107}:\\
\;\;\;\;\cosh x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.35000000000000003e154 or 3.20000000000000029e107 < x Initial program 100.0%
Taylor expanded in x around 0 85.8%
unpow269.2%
Simplified85.8%
Taylor expanded in x around inf 85.8%
associate-/l*92.2%
unpow292.2%
Simplified92.2%
if -1.35000000000000003e154 < x < -9.2e7 or 0.37 < x < 3.20000000000000029e107Initial program 100.0%
Taylor expanded in y around 0 85.0%
if -9.2e7 < x < 0.37Initial program 99.7%
Taylor expanded in x around 0 97.0%
Final simplification93.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.5 (/ (sin y) (/ y (* x x))))))
(if (<= x -1.35e+154)
t_0
(if (<= x -92000000.0)
(cosh x)
(if (<= x 0.37)
(/ (sin y) y)
(if (<= x 1.35e+154)
(* (cosh x) (+ 1.0 (* -0.16666666666666666 (* y y))))
t_0))))))
double code(double x, double y) {
double t_0 = 0.5 * (sin(y) / (y / (x * x)));
double tmp;
if (x <= -1.35e+154) {
tmp = t_0;
} else if (x <= -92000000.0) {
tmp = cosh(x);
} else if (x <= 0.37) {
tmp = sin(y) / y;
} else if (x <= 1.35e+154) {
tmp = cosh(x) * (1.0 + (-0.16666666666666666 * (y * y)));
} 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 = 0.5d0 * (sin(y) / (y / (x * x)))
if (x <= (-1.35d+154)) then
tmp = t_0
else if (x <= (-92000000.0d0)) then
tmp = cosh(x)
else if (x <= 0.37d0) then
tmp = sin(y) / y
else if (x <= 1.35d+154) then
tmp = cosh(x) * (1.0d0 + ((-0.16666666666666666d0) * (y * y)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.5 * (Math.sin(y) / (y / (x * x)));
double tmp;
if (x <= -1.35e+154) {
tmp = t_0;
} else if (x <= -92000000.0) {
tmp = Math.cosh(x);
} else if (x <= 0.37) {
tmp = Math.sin(y) / y;
} else if (x <= 1.35e+154) {
tmp = Math.cosh(x) * (1.0 + (-0.16666666666666666 * (y * y)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.5 * (math.sin(y) / (y / (x * x))) tmp = 0 if x <= -1.35e+154: tmp = t_0 elif x <= -92000000.0: tmp = math.cosh(x) elif x <= 0.37: tmp = math.sin(y) / y elif x <= 1.35e+154: tmp = math.cosh(x) * (1.0 + (-0.16666666666666666 * (y * y))) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.5 * Float64(sin(y) / Float64(y / Float64(x * x)))) tmp = 0.0 if (x <= -1.35e+154) tmp = t_0; elseif (x <= -92000000.0) tmp = cosh(x); elseif (x <= 0.37) tmp = Float64(sin(y) / y); elseif (x <= 1.35e+154) tmp = Float64(cosh(x) * Float64(1.0 + Float64(-0.16666666666666666 * Float64(y * y)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.5 * (sin(y) / (y / (x * x))); tmp = 0.0; if (x <= -1.35e+154) tmp = t_0; elseif (x <= -92000000.0) tmp = cosh(x); elseif (x <= 0.37) tmp = sin(y) / y; elseif (x <= 1.35e+154) tmp = cosh(x) * (1.0 + (-0.16666666666666666 * (y * y))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.5 * N[(N[Sin[y], $MachinePrecision] / N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e+154], t$95$0, If[LessEqual[x, -92000000.0], N[Cosh[x], $MachinePrecision], If[LessEqual[x, 0.37], N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, 1.35e+154], N[(N[Cosh[x], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \frac{\sin y}{\frac{y}{x \cdot x}}\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -92000000:\\
\;\;\;\;\cosh x\\
\mathbf{elif}\;x \leq 0.37:\\
\;\;\;\;\frac{\sin y}{y}\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\cosh x \cdot \left(1 + -0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.35000000000000003e154 or 1.35000000000000003e154 < x Initial program 100.0%
Taylor expanded in x around 0 100.0%
unpow280.8%
Simplified100.0%
Taylor expanded in x around inf 100.0%
associate-/l*100.0%
unpow2100.0%
Simplified100.0%
if -1.35000000000000003e154 < x < -9.2e7Initial program 100.0%
Taylor expanded in y around 0 92.3%
if -9.2e7 < x < 0.37Initial program 99.7%
Taylor expanded in x around 0 97.0%
if 0.37 < x < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in y around 0 85.2%
unpow240.4%
Simplified85.2%
Final simplification96.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.5 (/ (sin y) (/ y (* x x))))))
(if (<= x -1.35e+154)
t_0
(if (<= x -92000000.0)
(cosh x)
(if (<= x 0.37)
(* (/ (sin y) y) (+ 1.0 (* 0.5 (* x x))))
(if (<= x 1.35e+154)
(* (cosh x) (+ 1.0 (* -0.16666666666666666 (* y y))))
t_0))))))
double code(double x, double y) {
double t_0 = 0.5 * (sin(y) / (y / (x * x)));
double tmp;
if (x <= -1.35e+154) {
tmp = t_0;
} else if (x <= -92000000.0) {
tmp = cosh(x);
} else if (x <= 0.37) {
tmp = (sin(y) / y) * (1.0 + (0.5 * (x * x)));
} else if (x <= 1.35e+154) {
tmp = cosh(x) * (1.0 + (-0.16666666666666666 * (y * y)));
} 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 = 0.5d0 * (sin(y) / (y / (x * x)))
if (x <= (-1.35d+154)) then
tmp = t_0
else if (x <= (-92000000.0d0)) then
tmp = cosh(x)
else if (x <= 0.37d0) then
tmp = (sin(y) / y) * (1.0d0 + (0.5d0 * (x * x)))
else if (x <= 1.35d+154) then
tmp = cosh(x) * (1.0d0 + ((-0.16666666666666666d0) * (y * y)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.5 * (Math.sin(y) / (y / (x * x)));
double tmp;
if (x <= -1.35e+154) {
tmp = t_0;
} else if (x <= -92000000.0) {
tmp = Math.cosh(x);
} else if (x <= 0.37) {
tmp = (Math.sin(y) / y) * (1.0 + (0.5 * (x * x)));
} else if (x <= 1.35e+154) {
tmp = Math.cosh(x) * (1.0 + (-0.16666666666666666 * (y * y)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.5 * (math.sin(y) / (y / (x * x))) tmp = 0 if x <= -1.35e+154: tmp = t_0 elif x <= -92000000.0: tmp = math.cosh(x) elif x <= 0.37: tmp = (math.sin(y) / y) * (1.0 + (0.5 * (x * x))) elif x <= 1.35e+154: tmp = math.cosh(x) * (1.0 + (-0.16666666666666666 * (y * y))) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.5 * Float64(sin(y) / Float64(y / Float64(x * x)))) tmp = 0.0 if (x <= -1.35e+154) tmp = t_0; elseif (x <= -92000000.0) tmp = cosh(x); elseif (x <= 0.37) tmp = Float64(Float64(sin(y) / y) * Float64(1.0 + Float64(0.5 * Float64(x * x)))); elseif (x <= 1.35e+154) tmp = Float64(cosh(x) * Float64(1.0 + Float64(-0.16666666666666666 * Float64(y * y)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.5 * (sin(y) / (y / (x * x))); tmp = 0.0; if (x <= -1.35e+154) tmp = t_0; elseif (x <= -92000000.0) tmp = cosh(x); elseif (x <= 0.37) tmp = (sin(y) / y) * (1.0 + (0.5 * (x * x))); elseif (x <= 1.35e+154) tmp = cosh(x) * (1.0 + (-0.16666666666666666 * (y * y))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.5 * N[(N[Sin[y], $MachinePrecision] / N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e+154], t$95$0, If[LessEqual[x, -92000000.0], N[Cosh[x], $MachinePrecision], If[LessEqual[x, 0.37], N[(N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision] * N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+154], N[(N[Cosh[x], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \frac{\sin y}{\frac{y}{x \cdot x}}\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -92000000:\\
\;\;\;\;\cosh x\\
\mathbf{elif}\;x \leq 0.37:\\
\;\;\;\;\frac{\sin y}{y} \cdot \left(1 + 0.5 \cdot \left(x \cdot x\right)\right)\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\cosh x \cdot \left(1 + -0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.35000000000000003e154 or 1.35000000000000003e154 < x Initial program 100.0%
Taylor expanded in x around 0 100.0%
unpow280.8%
Simplified100.0%
Taylor expanded in x around inf 100.0%
associate-/l*100.0%
unpow2100.0%
Simplified100.0%
if -1.35000000000000003e154 < x < -9.2e7Initial program 100.0%
Taylor expanded in y around 0 92.3%
if -9.2e7 < x < 0.37Initial program 99.7%
Taylor expanded in x around 0 97.2%
unpow244.6%
Simplified97.2%
if 0.37 < x < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in y around 0 85.2%
unpow240.4%
Simplified85.2%
Final simplification96.2%
(FPCore (x y) :precision binary64 (if (<= y -3.4e+233) (+ 1.0 (* y (* y -0.16666666666666666))) (cosh x)))
double code(double x, double y) {
double tmp;
if (y <= -3.4e+233) {
tmp = 1.0 + (y * (y * -0.16666666666666666));
} else {
tmp = cosh(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+233)) then
tmp = 1.0d0 + (y * (y * (-0.16666666666666666d0)))
else
tmp = cosh(x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3.4e+233) {
tmp = 1.0 + (y * (y * -0.16666666666666666));
} else {
tmp = Math.cosh(x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3.4e+233: tmp = 1.0 + (y * (y * -0.16666666666666666)) else: tmp = math.cosh(x) return tmp
function code(x, y) tmp = 0.0 if (y <= -3.4e+233) tmp = Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666))); else tmp = cosh(x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3.4e+233) tmp = 1.0 + (y * (y * -0.16666666666666666)); else tmp = cosh(x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3.4e+233], N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Cosh[x], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+233}:\\
\;\;\;\;1 + y \cdot \left(y \cdot -0.16666666666666666\right)\\
\mathbf{else}:\\
\;\;\;\;\cosh x\\
\end{array}
\end{array}
if y < -3.40000000000000022e233Initial program 99.7%
Taylor expanded in x around 0 67.3%
unpow22.4%
Simplified67.3%
add-cube-cbrt66.7%
add-sqr-sqrt0.0%
times-frac0.0%
pow20.0%
Applied egg-rr0.0%
associate-*l/0.0%
associate-*r/0.0%
unpow20.0%
rem-3cbrt-lft0.0%
Simplified0.0%
Taylor expanded in x around 0 0.0%
Taylor expanded in y around 0 39.7%
*-commutative39.7%
unpow239.7%
associate-*l*39.7%
Simplified39.7%
if -3.40000000000000022e233 < y Initial program 99.9%
Taylor expanded in y around 0 65.0%
Final simplification63.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.5 (* x x))))
(if (<= x -4.4e-20)
(* 0.5 (/ (* y (* x x)) y))
(if (<= x 1.4e+54)
(+ 1.0 t_0)
(if (or (<= x 1e+154) (not (<= x 5e+201)))
(* 0.5 (* (* x x) (+ 1.0 (* -0.16666666666666666 (* y y)))))
t_0)))))
double code(double x, double y) {
double t_0 = 0.5 * (x * x);
double tmp;
if (x <= -4.4e-20) {
tmp = 0.5 * ((y * (x * x)) / y);
} else if (x <= 1.4e+54) {
tmp = 1.0 + t_0;
} else if ((x <= 1e+154) || !(x <= 5e+201)) {
tmp = 0.5 * ((x * x) * (1.0 + (-0.16666666666666666 * (y * y))));
} 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 = 0.5d0 * (x * x)
if (x <= (-4.4d-20)) then
tmp = 0.5d0 * ((y * (x * x)) / y)
else if (x <= 1.4d+54) then
tmp = 1.0d0 + t_0
else if ((x <= 1d+154) .or. (.not. (x <= 5d+201))) then
tmp = 0.5d0 * ((x * x) * (1.0d0 + ((-0.16666666666666666d0) * (y * y))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.5 * (x * x);
double tmp;
if (x <= -4.4e-20) {
tmp = 0.5 * ((y * (x * x)) / y);
} else if (x <= 1.4e+54) {
tmp = 1.0 + t_0;
} else if ((x <= 1e+154) || !(x <= 5e+201)) {
tmp = 0.5 * ((x * x) * (1.0 + (-0.16666666666666666 * (y * y))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.5 * (x * x) tmp = 0 if x <= -4.4e-20: tmp = 0.5 * ((y * (x * x)) / y) elif x <= 1.4e+54: tmp = 1.0 + t_0 elif (x <= 1e+154) or not (x <= 5e+201): tmp = 0.5 * ((x * x) * (1.0 + (-0.16666666666666666 * (y * y)))) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.5 * Float64(x * x)) tmp = 0.0 if (x <= -4.4e-20) tmp = Float64(0.5 * Float64(Float64(y * Float64(x * x)) / y)); elseif (x <= 1.4e+54) tmp = Float64(1.0 + t_0); elseif ((x <= 1e+154) || !(x <= 5e+201)) tmp = Float64(0.5 * Float64(Float64(x * x) * Float64(1.0 + Float64(-0.16666666666666666 * Float64(y * y))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.5 * (x * x); tmp = 0.0; if (x <= -4.4e-20) tmp = 0.5 * ((y * (x * x)) / y); elseif (x <= 1.4e+54) tmp = 1.0 + t_0; elseif ((x <= 1e+154) || ~((x <= 5e+201))) tmp = 0.5 * ((x * x) * (1.0 + (-0.16666666666666666 * (y * y)))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.4e-20], N[(0.5 * N[(N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4e+54], N[(1.0 + t$95$0), $MachinePrecision], If[Or[LessEqual[x, 1e+154], N[Not[LessEqual[x, 5e+201]], $MachinePrecision]], N[(0.5 * N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(x \cdot x\right)\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{-20}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot \left(x \cdot x\right)}{y}\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+54}:\\
\;\;\;\;1 + t_0\\
\mathbf{elif}\;x \leq 10^{+154} \lor \neg \left(x \leq 5 \cdot 10^{+201}\right):\\
\;\;\;\;0.5 \cdot \left(\left(x \cdot x\right) \cdot \left(1 + -0.16666666666666666 \cdot \left(y \cdot y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -4.39999999999999982e-20Initial program 99.9%
Taylor expanded in x around 0 61.1%
unpow248.6%
Simplified61.1%
add-cube-cbrt61.1%
add-sqr-sqrt33.2%
times-frac33.2%
pow233.2%
Applied egg-rr33.2%
associate-*l/33.2%
associate-*r/33.2%
unpow233.2%
rem-3cbrt-lft33.3%
Simplified33.3%
Taylor expanded in x around inf 58.6%
unpow258.6%
Simplified58.6%
Taylor expanded in y around 0 56.5%
unpow256.5%
Simplified56.5%
if -4.39999999999999982e-20 < x < 1.40000000000000008e54Initial program 99.8%
Taylor expanded in y around 0 48.3%
Taylor expanded in x around 0 44.0%
unpow244.0%
Simplified44.0%
if 1.40000000000000008e54 < x < 1.00000000000000004e154 or 4.9999999999999995e201 < x Initial program 100.0%
Taylor expanded in x around 0 56.0%
unpow238.8%
Simplified56.0%
add-cube-cbrt56.0%
add-sqr-sqrt19.9%
times-frac19.9%
pow219.9%
Applied egg-rr19.9%
associate-*l/19.9%
associate-*r/19.9%
unpow219.9%
rem-3cbrt-lft19.9%
Simplified19.9%
Taylor expanded in x around inf 56.0%
unpow256.0%
Simplified56.0%
Taylor expanded in y around 0 24.8%
unpow224.8%
associate-*r*24.8%
unpow224.8%
distribute-lft1-in68.9%
*-commutative68.9%
unpow268.9%
Simplified68.9%
if 1.00000000000000004e154 < x < 4.9999999999999995e201Initial program 100.0%
Taylor expanded in x around 0 100.0%
unpow2100.0%
Simplified100.0%
add-cube-cbrt100.0%
add-sqr-sqrt40.0%
times-frac40.0%
pow240.0%
Applied egg-rr40.0%
associate-*l/40.0%
associate-*r/40.0%
unpow240.0%
rem-3cbrt-lft40.0%
Simplified40.0%
Taylor expanded in x around inf 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
unpow2100.0%
Simplified100.0%
Final simplification53.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.5 (* x x))) (t_1 (+ 1.0 (* -0.16666666666666666 (* y y)))))
(if (<= x -4.4e-20)
(* 0.5 (/ (* y (* x x)) y))
(if (<= x 6.6e+155)
(* (+ 1.0 t_0) t_1)
(if (<= x 5e+201) t_0 (* 0.5 (* (* x x) t_1)))))))
double code(double x, double y) {
double t_0 = 0.5 * (x * x);
double t_1 = 1.0 + (-0.16666666666666666 * (y * y));
double tmp;
if (x <= -4.4e-20) {
tmp = 0.5 * ((y * (x * x)) / y);
} else if (x <= 6.6e+155) {
tmp = (1.0 + t_0) * t_1;
} else if (x <= 5e+201) {
tmp = t_0;
} else {
tmp = 0.5 * ((x * x) * 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 = 0.5d0 * (x * x)
t_1 = 1.0d0 + ((-0.16666666666666666d0) * (y * y))
if (x <= (-4.4d-20)) then
tmp = 0.5d0 * ((y * (x * x)) / y)
else if (x <= 6.6d+155) then
tmp = (1.0d0 + t_0) * t_1
else if (x <= 5d+201) then
tmp = t_0
else
tmp = 0.5d0 * ((x * x) * t_1)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.5 * (x * x);
double t_1 = 1.0 + (-0.16666666666666666 * (y * y));
double tmp;
if (x <= -4.4e-20) {
tmp = 0.5 * ((y * (x * x)) / y);
} else if (x <= 6.6e+155) {
tmp = (1.0 + t_0) * t_1;
} else if (x <= 5e+201) {
tmp = t_0;
} else {
tmp = 0.5 * ((x * x) * t_1);
}
return tmp;
}
def code(x, y): t_0 = 0.5 * (x * x) t_1 = 1.0 + (-0.16666666666666666 * (y * y)) tmp = 0 if x <= -4.4e-20: tmp = 0.5 * ((y * (x * x)) / y) elif x <= 6.6e+155: tmp = (1.0 + t_0) * t_1 elif x <= 5e+201: tmp = t_0 else: tmp = 0.5 * ((x * x) * t_1) return tmp
function code(x, y) t_0 = Float64(0.5 * Float64(x * x)) t_1 = Float64(1.0 + Float64(-0.16666666666666666 * Float64(y * y))) tmp = 0.0 if (x <= -4.4e-20) tmp = Float64(0.5 * Float64(Float64(y * Float64(x * x)) / y)); elseif (x <= 6.6e+155) tmp = Float64(Float64(1.0 + t_0) * t_1); elseif (x <= 5e+201) tmp = t_0; else tmp = Float64(0.5 * Float64(Float64(x * x) * t_1)); end return tmp end
function tmp_2 = code(x, y) t_0 = 0.5 * (x * x); t_1 = 1.0 + (-0.16666666666666666 * (y * y)); tmp = 0.0; if (x <= -4.4e-20) tmp = 0.5 * ((y * (x * x)) / y); elseif (x <= 6.6e+155) tmp = (1.0 + t_0) * t_1; elseif (x <= 5e+201) tmp = t_0; else tmp = 0.5 * ((x * x) * t_1); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(-0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.4e-20], N[(0.5 * N[(N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.6e+155], N[(N[(1.0 + t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[x, 5e+201], t$95$0, N[(0.5 * N[(N[(x * x), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(x \cdot x\right)\\
t_1 := 1 + -0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{-20}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot \left(x \cdot x\right)}{y}\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{+155}:\\
\;\;\;\;\left(1 + t_0\right) \cdot t_1\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+201}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\left(x \cdot x\right) \cdot t_1\right)\\
\end{array}
\end{array}
if x < -4.39999999999999982e-20Initial program 99.9%
Taylor expanded in x around 0 61.1%
unpow248.6%
Simplified61.1%
add-cube-cbrt61.1%
add-sqr-sqrt33.2%
times-frac33.2%
pow233.2%
Applied egg-rr33.2%
associate-*l/33.2%
associate-*r/33.2%
unpow233.2%
rem-3cbrt-lft33.3%
Simplified33.3%
Taylor expanded in x around inf 58.6%
unpow258.6%
Simplified58.6%
Taylor expanded in y around 0 56.5%
unpow256.5%
Simplified56.5%
if -4.39999999999999982e-20 < x < 6.5999999999999997e155Initial program 99.8%
Taylor expanded in x around 0 82.5%
unpow238.7%
Simplified82.5%
Taylor expanded in y around 0 44.4%
unpow244.4%
Simplified44.4%
if 6.5999999999999997e155 < x < 4.9999999999999995e201Initial program 100.0%
Taylor expanded in x around 0 100.0%
unpow2100.0%
Simplified100.0%
add-cube-cbrt100.0%
add-sqr-sqrt40.0%
times-frac40.0%
pow240.0%
Applied egg-rr40.0%
associate-*l/40.0%
associate-*r/40.0%
unpow240.0%
rem-3cbrt-lft40.0%
Simplified40.0%
Taylor expanded in x around inf 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
unpow2100.0%
Simplified100.0%
if 4.9999999999999995e201 < x Initial program 100.0%
Taylor expanded in x around 0 100.0%
unpow269.6%
Simplified100.0%
add-cube-cbrt100.0%
add-sqr-sqrt34.8%
times-frac34.8%
pow234.8%
Applied egg-rr34.8%
associate-*l/34.8%
associate-*r/34.8%
unpow234.8%
rem-3cbrt-lft34.8%
Simplified34.8%
Taylor expanded in x around inf 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in y around 0 0.0%
unpow20.0%
associate-*r*0.0%
unpow20.0%
distribute-lft1-in82.6%
*-commutative82.6%
unpow282.6%
Simplified82.6%
Final simplification53.3%
(FPCore (x y)
:precision binary64
(if (<= x -4.4e-20)
(* 0.5 (/ (* y (* x x)) y))
(if (<= x 1.26e+154)
(+ 1.0 (* y (* y -0.16666666666666666)))
(* 0.5 (* x x)))))
double code(double x, double y) {
double tmp;
if (x <= -4.4e-20) {
tmp = 0.5 * ((y * (x * x)) / y);
} else if (x <= 1.26e+154) {
tmp = 1.0 + (y * (y * -0.16666666666666666));
} else {
tmp = 0.5 * (x * x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.4d-20)) then
tmp = 0.5d0 * ((y * (x * x)) / y)
else if (x <= 1.26d+154) then
tmp = 1.0d0 + (y * (y * (-0.16666666666666666d0)))
else
tmp = 0.5d0 * (x * x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -4.4e-20) {
tmp = 0.5 * ((y * (x * x)) / y);
} else if (x <= 1.26e+154) {
tmp = 1.0 + (y * (y * -0.16666666666666666));
} else {
tmp = 0.5 * (x * x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4.4e-20: tmp = 0.5 * ((y * (x * x)) / y) elif x <= 1.26e+154: tmp = 1.0 + (y * (y * -0.16666666666666666)) else: tmp = 0.5 * (x * x) return tmp
function code(x, y) tmp = 0.0 if (x <= -4.4e-20) tmp = Float64(0.5 * Float64(Float64(y * Float64(x * x)) / y)); elseif (x <= 1.26e+154) tmp = Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666))); else tmp = Float64(0.5 * Float64(x * x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -4.4e-20) tmp = 0.5 * ((y * (x * x)) / y); elseif (x <= 1.26e+154) tmp = 1.0 + (y * (y * -0.16666666666666666)); else tmp = 0.5 * (x * x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4.4e-20], N[(0.5 * N[(N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.26e+154], N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{-20}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot \left(x \cdot x\right)}{y}\\
\mathbf{elif}\;x \leq 1.26 \cdot 10^{+154}:\\
\;\;\;\;1 + y \cdot \left(y \cdot -0.16666666666666666\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot x\right)\\
\end{array}
\end{array}
if x < -4.39999999999999982e-20Initial program 99.9%
Taylor expanded in x around 0 61.1%
unpow248.6%
Simplified61.1%
add-cube-cbrt61.1%
add-sqr-sqrt33.2%
times-frac33.2%
pow233.2%
Applied egg-rr33.2%
associate-*l/33.2%
associate-*r/33.2%
unpow233.2%
rem-3cbrt-lft33.3%
Simplified33.3%
Taylor expanded in x around inf 58.6%
unpow258.6%
Simplified58.6%
Taylor expanded in y around 0 56.5%
unpow256.5%
Simplified56.5%
if -4.39999999999999982e-20 < x < 1.26e154Initial program 99.8%
Taylor expanded in x around 0 82.5%
unpow238.7%
Simplified82.5%
add-cube-cbrt80.8%
add-sqr-sqrt37.2%
times-frac37.3%
pow237.3%
Applied egg-rr37.3%
associate-*l/37.3%
associate-*r/37.3%
unpow237.3%
rem-3cbrt-lft37.8%
Simplified37.8%
Taylor expanded in x around 0 37.5%
Taylor expanded in y around 0 41.6%
*-commutative41.6%
unpow241.6%
associate-*l*41.6%
Simplified41.6%
if 1.26e154 < x Initial program 100.0%
Taylor expanded in x around 0 100.0%
unpow278.8%
Simplified100.0%
add-cube-cbrt100.0%
add-sqr-sqrt36.4%
times-frac36.4%
pow236.4%
Applied egg-rr36.4%
associate-*l/36.4%
associate-*r/36.4%
unpow236.4%
rem-3cbrt-lft36.4%
Simplified36.4%
Taylor expanded in x around inf 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in y around 0 78.8%
unpow278.8%
Simplified78.8%
Final simplification50.5%
(FPCore (x y) :precision binary64 (if (<= x -4.4e-20) (* 0.5 (/ (* y (* x x)) y)) (if (<= x 6.2e-10) 1.0 (* 0.5 (* x x)))))
double code(double x, double y) {
double tmp;
if (x <= -4.4e-20) {
tmp = 0.5 * ((y * (x * x)) / y);
} else if (x <= 6.2e-10) {
tmp = 1.0;
} else {
tmp = 0.5 * (x * x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.4d-20)) then
tmp = 0.5d0 * ((y * (x * x)) / y)
else if (x <= 6.2d-10) then
tmp = 1.0d0
else
tmp = 0.5d0 * (x * x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -4.4e-20) {
tmp = 0.5 * ((y * (x * x)) / y);
} else if (x <= 6.2e-10) {
tmp = 1.0;
} else {
tmp = 0.5 * (x * x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4.4e-20: tmp = 0.5 * ((y * (x * x)) / y) elif x <= 6.2e-10: tmp = 1.0 else: tmp = 0.5 * (x * x) return tmp
function code(x, y) tmp = 0.0 if (x <= -4.4e-20) tmp = Float64(0.5 * Float64(Float64(y * Float64(x * x)) / y)); elseif (x <= 6.2e-10) tmp = 1.0; else tmp = Float64(0.5 * Float64(x * x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -4.4e-20) tmp = 0.5 * ((y * (x * x)) / y); elseif (x <= 6.2e-10) tmp = 1.0; else tmp = 0.5 * (x * x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4.4e-20], N[(0.5 * N[(N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.2e-10], 1.0, N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{-20}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot \left(x \cdot x\right)}{y}\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-10}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot x\right)\\
\end{array}
\end{array}
if x < -4.39999999999999982e-20Initial program 99.9%
Taylor expanded in x around 0 61.1%
unpow248.6%
Simplified61.1%
add-cube-cbrt61.1%
add-sqr-sqrt33.2%
times-frac33.2%
pow233.2%
Applied egg-rr33.2%
associate-*l/33.2%
associate-*r/33.2%
unpow233.2%
rem-3cbrt-lft33.3%
Simplified33.3%
Taylor expanded in x around inf 58.6%
unpow258.6%
Simplified58.6%
Taylor expanded in y around 0 56.5%
unpow256.5%
Simplified56.5%
if -4.39999999999999982e-20 < x < 6.2000000000000003e-10Initial program 99.8%
Taylor expanded in y around 0 46.9%
Taylor expanded in x around 0 46.9%
unpow246.9%
Simplified46.9%
Taylor expanded in x around 0 46.9%
if 6.2000000000000003e-10 < x Initial program 99.9%
Taylor expanded in x around 0 57.6%
unpow243.7%
Simplified57.6%
add-cube-cbrt57.6%
add-sqr-sqrt20.9%
times-frac20.9%
pow220.9%
Applied egg-rr20.9%
associate-*l/20.9%
associate-*r/20.9%
unpow220.9%
rem-3cbrt-lft20.9%
Simplified20.9%
Taylor expanded in x around inf 55.9%
unpow255.9%
Simplified55.9%
Taylor expanded in y around 0 43.7%
unpow243.7%
Simplified43.7%
Final simplification48.8%
(FPCore (x y) :precision binary64 (if (or (<= x -4.4e-20) (not (<= x 6.2e-10))) (* 0.5 (* x x)) 1.0))
double code(double x, double y) {
double tmp;
if ((x <= -4.4e-20) || !(x <= 6.2e-10)) {
tmp = 0.5 * (x * x);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-4.4d-20)) .or. (.not. (x <= 6.2d-10))) then
tmp = 0.5d0 * (x * x)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -4.4e-20) || !(x <= 6.2e-10)) {
tmp = 0.5 * (x * x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -4.4e-20) or not (x <= 6.2e-10): tmp = 0.5 * (x * x) else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if ((x <= -4.4e-20) || !(x <= 6.2e-10)) tmp = Float64(0.5 * Float64(x * x)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -4.4e-20) || ~((x <= 6.2e-10))) tmp = 0.5 * (x * x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -4.4e-20], N[Not[LessEqual[x, 6.2e-10]], $MachinePrecision]], N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{-20} \lor \neg \left(x \leq 6.2 \cdot 10^{-10}\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -4.39999999999999982e-20 or 6.2000000000000003e-10 < x Initial program 99.9%
Taylor expanded in x around 0 59.5%
unpow246.3%
Simplified59.5%
add-cube-cbrt59.5%
add-sqr-sqrt27.5%
times-frac27.5%
pow227.5%
Applied egg-rr27.5%
associate-*l/27.5%
associate-*r/27.5%
unpow227.5%
rem-3cbrt-lft27.5%
Simplified27.5%
Taylor expanded in x around inf 57.3%
unpow257.3%
Simplified57.3%
Taylor expanded in y around 0 46.3%
unpow246.3%
Simplified46.3%
if -4.39999999999999982e-20 < x < 6.2000000000000003e-10Initial program 99.8%
Taylor expanded in y around 0 46.9%
Taylor expanded in x around 0 46.9%
unpow246.9%
Simplified46.9%
Taylor expanded in x around 0 46.9%
Final simplification46.6%
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
return 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.9%
Taylor expanded in y around 0 61.3%
Taylor expanded in x around 0 46.6%
unpow246.6%
Simplified46.6%
Taylor expanded in x around 0 24.0%
Final simplification24.0%
(FPCore (x y) :precision binary64 (/ (* (cosh x) (sin y)) y))
double code(double x, double y) {
return (cosh(x) * sin(y)) / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (cosh(x) * sin(y)) / y
end function
public static double code(double x, double y) {
return (Math.cosh(x) * Math.sin(y)) / y;
}
def code(x, y): return (math.cosh(x) * math.sin(y)) / y
function code(x, y) return Float64(Float64(cosh(x) * sin(y)) / y) end
function tmp = code(x, y) tmp = (cosh(x) * sin(y)) / y; end
code[x_, y_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cosh x \cdot \sin y}{y}
\end{array}
herbie shell --seed 2023181
(FPCore (x y)
:name "Linear.Quaternion:$csinh from linear-1.19.1.3"
:precision binary64
:herbie-target
(/ (* (cosh x) (sin y)) y)
(* (cosh x) (/ (sin y) y)))