
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) y)))
double code(double x, double y) {
return sin(x) * (sinh(y) / y);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / y)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\sin x \cdot \frac{\sinh y}{y}
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) y)))
double code(double x, double y) {
return sin(x) * (sinh(y) / y);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / y);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / y)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / y)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / y); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\sin x \cdot \frac{\sinh y}{y}
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (fabs y) (fabs y)))
(t_1 (* (* t_0 (fabs y)) (* 1/36 (fabs y)))))
(if (<= (fabs y) 1261007895663739/9007199254740992)
(* (sin x) (/ (- (* (* 1/36 t_0) t_0) 1) (- (* t_0 1/6) 1)))
(if (<= (fabs y) 649999999999999935800862526406656)
(* (* (/ 1 (fabs y)) x) (sinh (fabs y)))
(* (sin x) (+ 1 (sqrt (sqrt (* t_1 t_1)))))))))double code(double x, double y) {
double t_0 = fabs(y) * fabs(y);
double t_1 = (t_0 * fabs(y)) * (0.027777777777777776 * fabs(y));
double tmp;
if (fabs(y) <= 0.14) {
tmp = sin(x) * ((((0.027777777777777776 * t_0) * t_0) - 1.0) / ((t_0 * 0.16666666666666666) - 1.0));
} else if (fabs(y) <= 6.5e+32) {
tmp = ((1.0 / fabs(y)) * x) * sinh(fabs(y));
} else {
tmp = sin(x) * (1.0 + sqrt(sqrt((t_1 * t_1))));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = abs(y) * abs(y)
t_1 = (t_0 * abs(y)) * (0.027777777777777776d0 * abs(y))
if (abs(y) <= 0.14d0) then
tmp = sin(x) * ((((0.027777777777777776d0 * t_0) * t_0) - 1.0d0) / ((t_0 * 0.16666666666666666d0) - 1.0d0))
else if (abs(y) <= 6.5d+32) then
tmp = ((1.0d0 / abs(y)) * x) * sinh(abs(y))
else
tmp = sin(x) * (1.0d0 + sqrt(sqrt((t_1 * t_1))))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.abs(y) * Math.abs(y);
double t_1 = (t_0 * Math.abs(y)) * (0.027777777777777776 * Math.abs(y));
double tmp;
if (Math.abs(y) <= 0.14) {
tmp = Math.sin(x) * ((((0.027777777777777776 * t_0) * t_0) - 1.0) / ((t_0 * 0.16666666666666666) - 1.0));
} else if (Math.abs(y) <= 6.5e+32) {
tmp = ((1.0 / Math.abs(y)) * x) * Math.sinh(Math.abs(y));
} else {
tmp = Math.sin(x) * (1.0 + Math.sqrt(Math.sqrt((t_1 * t_1))));
}
return tmp;
}
def code(x, y): t_0 = math.fabs(y) * math.fabs(y) t_1 = (t_0 * math.fabs(y)) * (0.027777777777777776 * math.fabs(y)) tmp = 0 if math.fabs(y) <= 0.14: tmp = math.sin(x) * ((((0.027777777777777776 * t_0) * t_0) - 1.0) / ((t_0 * 0.16666666666666666) - 1.0)) elif math.fabs(y) <= 6.5e+32: tmp = ((1.0 / math.fabs(y)) * x) * math.sinh(math.fabs(y)) else: tmp = math.sin(x) * (1.0 + math.sqrt(math.sqrt((t_1 * t_1)))) return tmp
function code(x, y) t_0 = Float64(abs(y) * abs(y)) t_1 = Float64(Float64(t_0 * abs(y)) * Float64(0.027777777777777776 * abs(y))) tmp = 0.0 if (abs(y) <= 0.14) tmp = Float64(sin(x) * Float64(Float64(Float64(Float64(0.027777777777777776 * t_0) * t_0) - 1.0) / Float64(Float64(t_0 * 0.16666666666666666) - 1.0))); elseif (abs(y) <= 6.5e+32) tmp = Float64(Float64(Float64(1.0 / abs(y)) * x) * sinh(abs(y))); else tmp = Float64(sin(x) * Float64(1.0 + sqrt(sqrt(Float64(t_1 * t_1))))); end return tmp end
function tmp_2 = code(x, y) t_0 = abs(y) * abs(y); t_1 = (t_0 * abs(y)) * (0.027777777777777776 * abs(y)); tmp = 0.0; if (abs(y) <= 0.14) tmp = sin(x) * ((((0.027777777777777776 * t_0) * t_0) - 1.0) / ((t_0 * 0.16666666666666666) - 1.0)); elseif (abs(y) <= 6.5e+32) tmp = ((1.0 / abs(y)) * x) * sinh(abs(y)); else tmp = sin(x) * (1.0 + sqrt(sqrt((t_1 * t_1)))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Abs[y], $MachinePrecision] * N[Abs[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * N[Abs[y], $MachinePrecision]), $MachinePrecision] * N[(1/36 * N[Abs[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[y], $MachinePrecision], 1261007895663739/9007199254740992], N[(N[Sin[x], $MachinePrecision] * N[(N[(N[(N[(1/36 * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision] - 1), $MachinePrecision] / N[(N[(t$95$0 * 1/6), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[y], $MachinePrecision], 649999999999999935800862526406656], N[(N[(N[(1 / N[Abs[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] * N[Sinh[N[Abs[y], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[x], $MachinePrecision] * N[(1 + N[Sqrt[N[Sqrt[N[(t$95$1 * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left|y\right| \cdot \left|y\right|\\
t_1 := \left(t\_0 \cdot \left|y\right|\right) \cdot \left(\frac{1}{36} \cdot \left|y\right|\right)\\
\mathbf{if}\;\left|y\right| \leq \frac{1261007895663739}{9007199254740992}:\\
\;\;\;\;\sin x \cdot \frac{\left(\frac{1}{36} \cdot t\_0\right) \cdot t\_0 - 1}{t\_0 \cdot \frac{1}{6} - 1}\\
\mathbf{elif}\;\left|y\right| \leq 649999999999999935800862526406656:\\
\;\;\;\;\left(\frac{1}{\left|y\right|} \cdot x\right) \cdot \sinh \left(\left|y\right|\right)\\
\mathbf{else}:\\
\;\;\;\;\sin x \cdot \left(1 + \sqrt{\sqrt{t\_1 \cdot t\_1}}\right)\\
\end{array}
if y < 0.14000000000000001Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6477.3%
Applied rewrites77.3%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6477.2%
Applied rewrites77.2%
Applied rewrites62.5%
if 0.14000000000000001 < y < 6.4999999999999994e32Initial program 100.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
mult-flip-revN/A
lower-/.f6488.3%
Applied rewrites88.3%
Taylor expanded in x around 0
lower-/.f6451.2%
Applied rewrites51.2%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6451.1%
Applied rewrites51.1%
if 6.4999999999999994e32 < y Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6477.3%
Applied rewrites77.3%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6477.2%
Applied rewrites77.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
fabs-sqrN/A
lift-*.f64N/A
fabs-mulN/A
*-commutativeN/A
lift-*.f64N/A
rem-sqrt-square-revN/A
lift-*.f64N/A
lower-sqrt.f6488.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
metadata-eval88.4%
Applied rewrites88.4%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-fabs-revN/A
lift-sqrt.f64N/A
rem-sqrt-square-revN/A
sqrt-unprodN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
Applied rewrites94.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (fabs y) (fabs y))) (t_1 (* (* 1/36 t_0) t_0)))
(if (<= (fabs y) 1261007895663739/9007199254740992)
(* (sin x) (/ (- t_1 1) (- (* t_0 1/6) 1)))
(if (<=
(fabs y)
42000000000000001333750431124433612527765488976574808201089382533455513911296)
(* (* (/ 1 (fabs y)) x) (sinh (fabs y)))
(* (sin x) (+ 1 (sqrt t_1)))))))double code(double x, double y) {
double t_0 = fabs(y) * fabs(y);
double t_1 = (0.027777777777777776 * t_0) * t_0;
double tmp;
if (fabs(y) <= 0.14) {
tmp = sin(x) * ((t_1 - 1.0) / ((t_0 * 0.16666666666666666) - 1.0));
} else if (fabs(y) <= 4.2e+76) {
tmp = ((1.0 / fabs(y)) * x) * sinh(fabs(y));
} else {
tmp = sin(x) * (1.0 + sqrt(t_1));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = abs(y) * abs(y)
t_1 = (0.027777777777777776d0 * t_0) * t_0
if (abs(y) <= 0.14d0) then
tmp = sin(x) * ((t_1 - 1.0d0) / ((t_0 * 0.16666666666666666d0) - 1.0d0))
else if (abs(y) <= 4.2d+76) then
tmp = ((1.0d0 / abs(y)) * x) * sinh(abs(y))
else
tmp = sin(x) * (1.0d0 + sqrt(t_1))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.abs(y) * Math.abs(y);
double t_1 = (0.027777777777777776 * t_0) * t_0;
double tmp;
if (Math.abs(y) <= 0.14) {
tmp = Math.sin(x) * ((t_1 - 1.0) / ((t_0 * 0.16666666666666666) - 1.0));
} else if (Math.abs(y) <= 4.2e+76) {
tmp = ((1.0 / Math.abs(y)) * x) * Math.sinh(Math.abs(y));
} else {
tmp = Math.sin(x) * (1.0 + Math.sqrt(t_1));
}
return tmp;
}
def code(x, y): t_0 = math.fabs(y) * math.fabs(y) t_1 = (0.027777777777777776 * t_0) * t_0 tmp = 0 if math.fabs(y) <= 0.14: tmp = math.sin(x) * ((t_1 - 1.0) / ((t_0 * 0.16666666666666666) - 1.0)) elif math.fabs(y) <= 4.2e+76: tmp = ((1.0 / math.fabs(y)) * x) * math.sinh(math.fabs(y)) else: tmp = math.sin(x) * (1.0 + math.sqrt(t_1)) return tmp
function code(x, y) t_0 = Float64(abs(y) * abs(y)) t_1 = Float64(Float64(0.027777777777777776 * t_0) * t_0) tmp = 0.0 if (abs(y) <= 0.14) tmp = Float64(sin(x) * Float64(Float64(t_1 - 1.0) / Float64(Float64(t_0 * 0.16666666666666666) - 1.0))); elseif (abs(y) <= 4.2e+76) tmp = Float64(Float64(Float64(1.0 / abs(y)) * x) * sinh(abs(y))); else tmp = Float64(sin(x) * Float64(1.0 + sqrt(t_1))); end return tmp end
function tmp_2 = code(x, y) t_0 = abs(y) * abs(y); t_1 = (0.027777777777777776 * t_0) * t_0; tmp = 0.0; if (abs(y) <= 0.14) tmp = sin(x) * ((t_1 - 1.0) / ((t_0 * 0.16666666666666666) - 1.0)); elseif (abs(y) <= 4.2e+76) tmp = ((1.0 / abs(y)) * x) * sinh(abs(y)); else tmp = sin(x) * (1.0 + sqrt(t_1)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Abs[y], $MachinePrecision] * N[Abs[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1/36 * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[N[Abs[y], $MachinePrecision], 1261007895663739/9007199254740992], N[(N[Sin[x], $MachinePrecision] * N[(N[(t$95$1 - 1), $MachinePrecision] / N[(N[(t$95$0 * 1/6), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[y], $MachinePrecision], 42000000000000001333750431124433612527765488976574808201089382533455513911296], N[(N[(N[(1 / N[Abs[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] * N[Sinh[N[Abs[y], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[x], $MachinePrecision] * N[(1 + N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left|y\right| \cdot \left|y\right|\\
t_1 := \left(\frac{1}{36} \cdot t\_0\right) \cdot t\_0\\
\mathbf{if}\;\left|y\right| \leq \frac{1261007895663739}{9007199254740992}:\\
\;\;\;\;\sin x \cdot \frac{t\_1 - 1}{t\_0 \cdot \frac{1}{6} - 1}\\
\mathbf{elif}\;\left|y\right| \leq 42000000000000001333750431124433612527765488976574808201089382533455513911296:\\
\;\;\;\;\left(\frac{1}{\left|y\right|} \cdot x\right) \cdot \sinh \left(\left|y\right|\right)\\
\mathbf{else}:\\
\;\;\;\;\sin x \cdot \left(1 + \sqrt{t\_1}\right)\\
\end{array}
if y < 0.14000000000000001Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6477.3%
Applied rewrites77.3%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6477.2%
Applied rewrites77.2%
Applied rewrites62.5%
if 0.14000000000000001 < y < 4.2000000000000001e76Initial program 100.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
mult-flip-revN/A
lower-/.f6488.3%
Applied rewrites88.3%
Taylor expanded in x around 0
lower-/.f6451.2%
Applied rewrites51.2%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6451.1%
Applied rewrites51.1%
if 4.2000000000000001e76 < y Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6477.3%
Applied rewrites77.3%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6477.2%
Applied rewrites77.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
fabs-sqrN/A
lift-*.f64N/A
fabs-mulN/A
*-commutativeN/A
lift-*.f64N/A
rem-sqrt-square-revN/A
lift-*.f64N/A
lower-sqrt.f6488.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
metadata-eval88.4%
Applied rewrites88.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (fabs y) (fabs y))))
(if (<= (fabs y) 1261007895663739/9007199254740992)
(* (sin x) (+ 1 (* (* 1/6 (fabs y)) (fabs y))))
(if (<=
(fabs y)
42000000000000001333750431124433612527765488976574808201089382533455513911296)
(* (* (/ 1 (fabs y)) x) (sinh (fabs y)))
(* (sin x) (+ 1 (sqrt (* (* 1/36 t_0) t_0))))))))double code(double x, double y) {
double t_0 = fabs(y) * fabs(y);
double tmp;
if (fabs(y) <= 0.14) {
tmp = sin(x) * (1.0 + ((0.16666666666666666 * fabs(y)) * fabs(y)));
} else if (fabs(y) <= 4.2e+76) {
tmp = ((1.0 / fabs(y)) * x) * sinh(fabs(y));
} else {
tmp = sin(x) * (1.0 + sqrt(((0.027777777777777776 * t_0) * t_0)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = abs(y) * abs(y)
if (abs(y) <= 0.14d0) then
tmp = sin(x) * (1.0d0 + ((0.16666666666666666d0 * abs(y)) * abs(y)))
else if (abs(y) <= 4.2d+76) then
tmp = ((1.0d0 / abs(y)) * x) * sinh(abs(y))
else
tmp = sin(x) * (1.0d0 + sqrt(((0.027777777777777776d0 * t_0) * t_0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.abs(y) * Math.abs(y);
double tmp;
if (Math.abs(y) <= 0.14) {
tmp = Math.sin(x) * (1.0 + ((0.16666666666666666 * Math.abs(y)) * Math.abs(y)));
} else if (Math.abs(y) <= 4.2e+76) {
tmp = ((1.0 / Math.abs(y)) * x) * Math.sinh(Math.abs(y));
} else {
tmp = Math.sin(x) * (1.0 + Math.sqrt(((0.027777777777777776 * t_0) * t_0)));
}
return tmp;
}
def code(x, y): t_0 = math.fabs(y) * math.fabs(y) tmp = 0 if math.fabs(y) <= 0.14: tmp = math.sin(x) * (1.0 + ((0.16666666666666666 * math.fabs(y)) * math.fabs(y))) elif math.fabs(y) <= 4.2e+76: tmp = ((1.0 / math.fabs(y)) * x) * math.sinh(math.fabs(y)) else: tmp = math.sin(x) * (1.0 + math.sqrt(((0.027777777777777776 * t_0) * t_0))) return tmp
function code(x, y) t_0 = Float64(abs(y) * abs(y)) tmp = 0.0 if (abs(y) <= 0.14) tmp = Float64(sin(x) * Float64(1.0 + Float64(Float64(0.16666666666666666 * abs(y)) * abs(y)))); elseif (abs(y) <= 4.2e+76) tmp = Float64(Float64(Float64(1.0 / abs(y)) * x) * sinh(abs(y))); else tmp = Float64(sin(x) * Float64(1.0 + sqrt(Float64(Float64(0.027777777777777776 * t_0) * t_0)))); end return tmp end
function tmp_2 = code(x, y) t_0 = abs(y) * abs(y); tmp = 0.0; if (abs(y) <= 0.14) tmp = sin(x) * (1.0 + ((0.16666666666666666 * abs(y)) * abs(y))); elseif (abs(y) <= 4.2e+76) tmp = ((1.0 / abs(y)) * x) * sinh(abs(y)); else tmp = sin(x) * (1.0 + sqrt(((0.027777777777777776 * t_0) * t_0))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Abs[y], $MachinePrecision] * N[Abs[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[y], $MachinePrecision], 1261007895663739/9007199254740992], N[(N[Sin[x], $MachinePrecision] * N[(1 + N[(N[(1/6 * N[Abs[y], $MachinePrecision]), $MachinePrecision] * N[Abs[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[y], $MachinePrecision], 42000000000000001333750431124433612527765488976574808201089382533455513911296], N[(N[(N[(1 / N[Abs[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] * N[Sinh[N[Abs[y], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[x], $MachinePrecision] * N[(1 + N[Sqrt[N[(N[(1/36 * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \left|y\right| \cdot \left|y\right|\\
\mathbf{if}\;\left|y\right| \leq \frac{1261007895663739}{9007199254740992}:\\
\;\;\;\;\sin x \cdot \left(1 + \left(\frac{1}{6} \cdot \left|y\right|\right) \cdot \left|y\right|\right)\\
\mathbf{elif}\;\left|y\right| \leq 42000000000000001333750431124433612527765488976574808201089382533455513911296:\\
\;\;\;\;\left(\frac{1}{\left|y\right|} \cdot x\right) \cdot \sinh \left(\left|y\right|\right)\\
\mathbf{else}:\\
\;\;\;\;\sin x \cdot \left(1 + \sqrt{\left(\frac{1}{36} \cdot t\_0\right) \cdot t\_0}\right)\\
\end{array}
if y < 0.14000000000000001Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6477.3%
Applied rewrites77.3%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6477.2%
Applied rewrites77.2%
if 0.14000000000000001 < y < 4.2000000000000001e76Initial program 100.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
mult-flip-revN/A
lower-/.f6488.3%
Applied rewrites88.3%
Taylor expanded in x around 0
lower-/.f6451.2%
Applied rewrites51.2%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6451.1%
Applied rewrites51.1%
if 4.2000000000000001e76 < y Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6477.3%
Applied rewrites77.3%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6477.2%
Applied rewrites77.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
fabs-sqrN/A
lift-*.f64N/A
fabs-mulN/A
*-commutativeN/A
lift-*.f64N/A
rem-sqrt-square-revN/A
lift-*.f64N/A
lower-sqrt.f6488.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
metadata-eval88.4%
Applied rewrites88.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sin x) (+ 1 (* (* 1/6 (fabs y)) (fabs y))))))
(if (<= (fabs y) 1261007895663739/9007199254740992)
t_0
(if (<=
(fabs y)
22500000000000000459178351141959369210816864978487727427761875070431876369408262113249838982777431993744833480349327934346847195128257057415137899157913600)
(* (* (/ 1 (fabs y)) x) (sinh (fabs y)))
t_0))))double code(double x, double y) {
double t_0 = sin(x) * (1.0 + ((0.16666666666666666 * fabs(y)) * fabs(y)));
double tmp;
if (fabs(y) <= 0.14) {
tmp = t_0;
} else if (fabs(y) <= 2.25e+154) {
tmp = ((1.0 / fabs(y)) * x) * sinh(fabs(y));
} else {
tmp = t_0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = sin(x) * (1.0d0 + ((0.16666666666666666d0 * abs(y)) * abs(y)))
if (abs(y) <= 0.14d0) then
tmp = t_0
else if (abs(y) <= 2.25d+154) then
tmp = ((1.0d0 / abs(y)) * x) * sinh(abs(y))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sin(x) * (1.0 + ((0.16666666666666666 * Math.abs(y)) * Math.abs(y)));
double tmp;
if (Math.abs(y) <= 0.14) {
tmp = t_0;
} else if (Math.abs(y) <= 2.25e+154) {
tmp = ((1.0 / Math.abs(y)) * x) * Math.sinh(Math.abs(y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = math.sin(x) * (1.0 + ((0.16666666666666666 * math.fabs(y)) * math.fabs(y))) tmp = 0 if math.fabs(y) <= 0.14: tmp = t_0 elif math.fabs(y) <= 2.25e+154: tmp = ((1.0 / math.fabs(y)) * x) * math.sinh(math.fabs(y)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(sin(x) * Float64(1.0 + Float64(Float64(0.16666666666666666 * abs(y)) * abs(y)))) tmp = 0.0 if (abs(y) <= 0.14) tmp = t_0; elseif (abs(y) <= 2.25e+154) tmp = Float64(Float64(Float64(1.0 / abs(y)) * x) * sinh(abs(y))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = sin(x) * (1.0 + ((0.16666666666666666 * abs(y)) * abs(y))); tmp = 0.0; if (abs(y) <= 0.14) tmp = t_0; elseif (abs(y) <= 2.25e+154) tmp = ((1.0 / abs(y)) * x) * sinh(abs(y)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sin[x], $MachinePrecision] * N[(1 + N[(N[(1/6 * N[Abs[y], $MachinePrecision]), $MachinePrecision] * N[Abs[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[y], $MachinePrecision], 1261007895663739/9007199254740992], t$95$0, If[LessEqual[N[Abs[y], $MachinePrecision], 22500000000000000459178351141959369210816864978487727427761875070431876369408262113249838982777431993744833480349327934346847195128257057415137899157913600], N[(N[(N[(1 / N[Abs[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] * N[Sinh[N[Abs[y], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \sin x \cdot \left(1 + \left(\frac{1}{6} \cdot \left|y\right|\right) \cdot \left|y\right|\right)\\
\mathbf{if}\;\left|y\right| \leq \frac{1261007895663739}{9007199254740992}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\left|y\right| \leq 22500000000000000459178351141959369210816864978487727427761875070431876369408262113249838982777431993744833480349327934346847195128257057415137899157913600:\\
\;\;\;\;\left(\frac{1}{\left|y\right|} \cdot x\right) \cdot \sinh \left(\left|y\right|\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y < 0.14000000000000001 or 2.25e154 < y Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6477.3%
Applied rewrites77.3%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6477.2%
Applied rewrites77.2%
if 0.14000000000000001 < y < 2.25e154Initial program 100.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
mult-flip-revN/A
lower-/.f6488.3%
Applied rewrites88.3%
Taylor expanded in x around 0
lower-/.f6451.2%
Applied rewrites51.2%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6451.1%
Applied rewrites51.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sin x) (+ 1 (* (* 1/6 (fabs y)) (fabs y))))))
(if (<= (fabs y) 1261007895663739/9007199254740992)
t_0
(if (<=
(fabs y)
22500000000000000459178351141959369210816864978487727427761875070431876369408262113249838982777431993744833480349327934346847195128257057415137899157913600)
(* (/ x (fabs y)) (sinh (fabs y)))
t_0))))double code(double x, double y) {
double t_0 = sin(x) * (1.0 + ((0.16666666666666666 * fabs(y)) * fabs(y)));
double tmp;
if (fabs(y) <= 0.14) {
tmp = t_0;
} else if (fabs(y) <= 2.25e+154) {
tmp = (x / fabs(y)) * sinh(fabs(y));
} else {
tmp = t_0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = sin(x) * (1.0d0 + ((0.16666666666666666d0 * abs(y)) * abs(y)))
if (abs(y) <= 0.14d0) then
tmp = t_0
else if (abs(y) <= 2.25d+154) then
tmp = (x / abs(y)) * sinh(abs(y))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sin(x) * (1.0 + ((0.16666666666666666 * Math.abs(y)) * Math.abs(y)));
double tmp;
if (Math.abs(y) <= 0.14) {
tmp = t_0;
} else if (Math.abs(y) <= 2.25e+154) {
tmp = (x / Math.abs(y)) * Math.sinh(Math.abs(y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = math.sin(x) * (1.0 + ((0.16666666666666666 * math.fabs(y)) * math.fabs(y))) tmp = 0 if math.fabs(y) <= 0.14: tmp = t_0 elif math.fabs(y) <= 2.25e+154: tmp = (x / math.fabs(y)) * math.sinh(math.fabs(y)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(sin(x) * Float64(1.0 + Float64(Float64(0.16666666666666666 * abs(y)) * abs(y)))) tmp = 0.0 if (abs(y) <= 0.14) tmp = t_0; elseif (abs(y) <= 2.25e+154) tmp = Float64(Float64(x / abs(y)) * sinh(abs(y))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = sin(x) * (1.0 + ((0.16666666666666666 * abs(y)) * abs(y))); tmp = 0.0; if (abs(y) <= 0.14) tmp = t_0; elseif (abs(y) <= 2.25e+154) tmp = (x / abs(y)) * sinh(abs(y)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sin[x], $MachinePrecision] * N[(1 + N[(N[(1/6 * N[Abs[y], $MachinePrecision]), $MachinePrecision] * N[Abs[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[y], $MachinePrecision], 1261007895663739/9007199254740992], t$95$0, If[LessEqual[N[Abs[y], $MachinePrecision], 22500000000000000459178351141959369210816864978487727427761875070431876369408262113249838982777431993744833480349327934346847195128257057415137899157913600], N[(N[(x / N[Abs[y], $MachinePrecision]), $MachinePrecision] * N[Sinh[N[Abs[y], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \sin x \cdot \left(1 + \left(\frac{1}{6} \cdot \left|y\right|\right) \cdot \left|y\right|\right)\\
\mathbf{if}\;\left|y\right| \leq \frac{1261007895663739}{9007199254740992}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\left|y\right| \leq 22500000000000000459178351141959369210816864978487727427761875070431876369408262113249838982777431993744833480349327934346847195128257057415137899157913600:\\
\;\;\;\;\frac{x}{\left|y\right|} \cdot \sinh \left(\left|y\right|\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y < 0.14000000000000001 or 2.25e154 < y Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6477.3%
Applied rewrites77.3%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6477.2%
Applied rewrites77.2%
if 0.14000000000000001 < y < 2.25e154Initial program 100.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
mult-flip-revN/A
lower-/.f6488.3%
Applied rewrites88.3%
Taylor expanded in x around 0
lower-/.f6451.2%
Applied rewrites51.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (sin (fabs x))))
(*
(copysign 1 x)
(if (<= (* t_0 (/ (sinh y) y)) 5)
(* t_0 1)
(* (/ (fabs x) y) (sinh y))))))double code(double x, double y) {
double t_0 = sin(fabs(x));
double tmp;
if ((t_0 * (sinh(y) / y)) <= 5.0) {
tmp = t_0 * 1.0;
} else {
tmp = (fabs(x) / y) * sinh(y);
}
return copysign(1.0, x) * tmp;
}
public static double code(double x, double y) {
double t_0 = Math.sin(Math.abs(x));
double tmp;
if ((t_0 * (Math.sinh(y) / y)) <= 5.0) {
tmp = t_0 * 1.0;
} else {
tmp = (Math.abs(x) / y) * Math.sinh(y);
}
return Math.copySign(1.0, x) * tmp;
}
def code(x, y): t_0 = math.sin(math.fabs(x)) tmp = 0 if (t_0 * (math.sinh(y) / y)) <= 5.0: tmp = t_0 * 1.0 else: tmp = (math.fabs(x) / y) * math.sinh(y) return math.copysign(1.0, x) * tmp
function code(x, y) t_0 = sin(abs(x)) tmp = 0.0 if (Float64(t_0 * Float64(sinh(y) / y)) <= 5.0) tmp = Float64(t_0 * 1.0); else tmp = Float64(Float64(abs(x) / y) * sinh(y)); end return Float64(copysign(1.0, x) * tmp) end
function tmp_2 = code(x, y) t_0 = sin(abs(x)); tmp = 0.0; if ((t_0 * (sinh(y) / y)) <= 5.0) tmp = t_0 * 1.0; else tmp = (abs(x) / y) * sinh(y); end tmp_2 = (sign(x) * abs(1.0)) * tmp; end
code[x_, y_] := Block[{t$95$0 = N[Sin[N[Abs[x], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(t$95$0 * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 5], N[(t$95$0 * 1), $MachinePrecision], N[(N[(N[Abs[x], $MachinePrecision] / y), $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_0 := \sin \left(\left|x\right|\right)\\
\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \cdot \frac{\sinh y}{y} \leq 5:\\
\;\;\;\;t\_0 \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\frac{\left|x\right|}{y} \cdot \sinh y\\
\end{array}
\end{array}
if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 5Initial program 100.0%
Taylor expanded in y around 0
Applied rewrites51.5%
if 5 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) Initial program 100.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
mult-flip-revN/A
lower-/.f6488.3%
Applied rewrites88.3%
Taylor expanded in x around 0
lower-/.f6451.2%
Applied rewrites51.2%
(FPCore (x y) :precision binary64 (* (sin x) 1))
double code(double x, double y) {
return sin(x) * 1.0;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * 1.0d0
end function
public static double code(double x, double y) {
return Math.sin(x) * 1.0;
}
def code(x, y): return math.sin(x) * 1.0
function code(x, y) return Float64(sin(x) * 1.0) end
function tmp = code(x, y) tmp = sin(x) * 1.0; end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * 1), $MachinePrecision]
\sin x \cdot 1
Initial program 100.0%
Taylor expanded in y around 0
Applied rewrites51.5%
herbie shell --seed 2025271 -o generate:evaluate
(FPCore (x y)
:name "Linear.Quaternion:$ccos from linear-1.19.1.3"
:precision binary64
(* (sin x) (/ (sinh y) y)))