
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
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, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (cosh(x) * (y / x)) / z
end function
public static double code(double x, double y, double z) {
return (Math.cosh(x) * (y / x)) / z;
}
def code(x, y, z): return (math.cosh(x) * (y / x)) / z
function code(x, y, z) return Float64(Float64(cosh(x) * Float64(y / x)) / z) end
function tmp = code(x, y, z) tmp = (cosh(x) * (y / x)) / z; end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\frac{\cosh x \cdot \frac{y}{x}}{z}
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
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, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (cosh(x) * (y / x)) / z
end function
public static double code(double x, double y, double z) {
return (Math.cosh(x) * (y / x)) / z;
}
def code(x, y, z): return (math.cosh(x) * (y / x)) / z
function code(x, y, z) return Float64(Float64(cosh(x) * Float64(y / x)) / z) end
function tmp = code(x, y, z) tmp = (cosh(x) * (y / x)) / z; end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\frac{\cosh x \cdot \frac{y}{x}}{z}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (cosh (fabs x))))
(*
(copysign 1.0 x)
(*
(copysign 1.0 y)
(*
(copysign 1.0 z)
(if (<= (/ (* t_0 (/ (fabs y) (fabs x))) (fabs z)) 2e-102)
(* (/ 1.0 (/ (fabs x) (fabs y))) (/ 1.0 (fabs z)))
(/ (/ (* (fabs y) t_0) (fabs z)) (fabs x))))))))double code(double x, double y, double z) {
double t_0 = cosh(fabs(x));
double tmp;
if (((t_0 * (fabs(y) / fabs(x))) / fabs(z)) <= 2e-102) {
tmp = (1.0 / (fabs(x) / fabs(y))) * (1.0 / fabs(z));
} else {
tmp = ((fabs(y) * t_0) / fabs(z)) / fabs(x);
}
return copysign(1.0, x) * (copysign(1.0, y) * (copysign(1.0, z) * tmp));
}
public static double code(double x, double y, double z) {
double t_0 = Math.cosh(Math.abs(x));
double tmp;
if (((t_0 * (Math.abs(y) / Math.abs(x))) / Math.abs(z)) <= 2e-102) {
tmp = (1.0 / (Math.abs(x) / Math.abs(y))) * (1.0 / Math.abs(z));
} else {
tmp = ((Math.abs(y) * t_0) / Math.abs(z)) / Math.abs(x);
}
return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * (Math.copySign(1.0, z) * tmp));
}
def code(x, y, z): t_0 = math.cosh(math.fabs(x)) tmp = 0 if ((t_0 * (math.fabs(y) / math.fabs(x))) / math.fabs(z)) <= 2e-102: tmp = (1.0 / (math.fabs(x) / math.fabs(y))) * (1.0 / math.fabs(z)) else: tmp = ((math.fabs(y) * t_0) / math.fabs(z)) / math.fabs(x) return math.copysign(1.0, x) * (math.copysign(1.0, y) * (math.copysign(1.0, z) * tmp))
function code(x, y, z) t_0 = cosh(abs(x)) tmp = 0.0 if (Float64(Float64(t_0 * Float64(abs(y) / abs(x))) / abs(z)) <= 2e-102) tmp = Float64(Float64(1.0 / Float64(abs(x) / abs(y))) * Float64(1.0 / abs(z))); else tmp = Float64(Float64(Float64(abs(y) * t_0) / abs(z)) / abs(x)); end return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * Float64(copysign(1.0, z) * tmp))) end
function tmp_2 = code(x, y, z) t_0 = cosh(abs(x)); tmp = 0.0; if (((t_0 * (abs(y) / abs(x))) / abs(z)) <= 2e-102) tmp = (1.0 / (abs(x) / abs(y))) * (1.0 / abs(z)); else tmp = ((abs(y) * t_0) / abs(z)) / abs(x); end tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * ((sign(z) * abs(1.0)) * tmp)); end
code[x_, y_, z_] := Block[{t$95$0 = N[Cosh[N[Abs[x], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(t$95$0 * N[(N[Abs[y], $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision], 2e-102], N[(N[(1.0 / N[(N[Abs[x], $MachinePrecision] / N[Abs[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Abs[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Abs[y], $MachinePrecision] * t$95$0), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
t_0 := \cosh \left(\left|x\right|\right)\\
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
\mathbf{if}\;\frac{t\_0 \cdot \frac{\left|y\right|}{\left|x\right|}}{\left|z\right|} \leq 2 \cdot 10^{-102}:\\
\;\;\;\;\frac{1}{\frac{\left|x\right|}{\left|y\right|}} \cdot \frac{1}{\left|z\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left|y\right| \cdot t\_0}{\left|z\right|}}{\left|x\right|}\\
\end{array}\right)\right)
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 1.9999999999999999e-102Initial program 85.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6449.4%
Applied rewrites49.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
mult-flipN/A
lift-/.f64N/A
lower-*.f64N/A
lower-/.f6449.5%
Applied rewrites49.5%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6449.4%
Applied rewrites49.4%
if 1.9999999999999999e-102 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 85.1%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
mult-flip-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6496.2%
Applied rewrites96.2%
(FPCore (x y z) :precision binary64 (let* ((t_0 (/ (* (cosh x) (/ y x)) z))) (if (<= t_0 INFINITY) t_0 (* y (/ (cosh x) (* z x))))))
double code(double x, double y, double z) {
double t_0 = (cosh(x) * (y / x)) / z;
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = y * (cosh(x) / (z * x));
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = (Math.cosh(x) * (y / x)) / z;
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0;
} else {
tmp = y * (Math.cosh(x) / (z * x));
}
return tmp;
}
def code(x, y, z): t_0 = (math.cosh(x) * (y / x)) / z tmp = 0 if t_0 <= math.inf: tmp = t_0 else: tmp = y * (math.cosh(x) / (z * x)) return tmp
function code(x, y, z) t_0 = Float64(Float64(cosh(x) * Float64(y / x)) / z) tmp = 0.0 if (t_0 <= Inf) tmp = t_0; else tmp = Float64(y * Float64(cosh(x) / Float64(z * x))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (cosh(x) * (y / x)) / z; tmp = 0.0; if (t_0 <= Inf) tmp = t_0; else tmp = y * (cosh(x) / (z * x)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], t$95$0, N[(y * N[(N[Cosh[x], $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \frac{\cosh x \cdot \frac{y}{x}}{z}\\
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\cosh x}{z \cdot x}\\
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < +inf.0Initial program 85.1%
if +inf.0 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 85.1%
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-/l/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6483.3%
Applied rewrites83.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (cosh (fabs x))) (t_1 (/ (fabs y) (fabs x))))
(*
(copysign 1.0 x)
(*
(copysign 1.0 y)
(*
(copysign 1.0 z)
(if (<= (/ (* t_0 t_1) (fabs z)) 1e+296)
(/ t_1 (fabs z))
(* (fabs y) (/ t_0 (* (fabs z) (fabs x))))))))))double code(double x, double y, double z) {
double t_0 = cosh(fabs(x));
double t_1 = fabs(y) / fabs(x);
double tmp;
if (((t_0 * t_1) / fabs(z)) <= 1e+296) {
tmp = t_1 / fabs(z);
} else {
tmp = fabs(y) * (t_0 / (fabs(z) * fabs(x)));
}
return copysign(1.0, x) * (copysign(1.0, y) * (copysign(1.0, z) * tmp));
}
public static double code(double x, double y, double z) {
double t_0 = Math.cosh(Math.abs(x));
double t_1 = Math.abs(y) / Math.abs(x);
double tmp;
if (((t_0 * t_1) / Math.abs(z)) <= 1e+296) {
tmp = t_1 / Math.abs(z);
} else {
tmp = Math.abs(y) * (t_0 / (Math.abs(z) * Math.abs(x)));
}
return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * (Math.copySign(1.0, z) * tmp));
}
def code(x, y, z): t_0 = math.cosh(math.fabs(x)) t_1 = math.fabs(y) / math.fabs(x) tmp = 0 if ((t_0 * t_1) / math.fabs(z)) <= 1e+296: tmp = t_1 / math.fabs(z) else: tmp = math.fabs(y) * (t_0 / (math.fabs(z) * math.fabs(x))) return math.copysign(1.0, x) * (math.copysign(1.0, y) * (math.copysign(1.0, z) * tmp))
function code(x, y, z) t_0 = cosh(abs(x)) t_1 = Float64(abs(y) / abs(x)) tmp = 0.0 if (Float64(Float64(t_0 * t_1) / abs(z)) <= 1e+296) tmp = Float64(t_1 / abs(z)); else tmp = Float64(abs(y) * Float64(t_0 / Float64(abs(z) * abs(x)))); end return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * Float64(copysign(1.0, z) * tmp))) end
function tmp_2 = code(x, y, z) t_0 = cosh(abs(x)); t_1 = abs(y) / abs(x); tmp = 0.0; if (((t_0 * t_1) / abs(z)) <= 1e+296) tmp = t_1 / abs(z); else tmp = abs(y) * (t_0 / (abs(z) * abs(x))); end tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * ((sign(z) * abs(1.0)) * tmp)); end
code[x_, y_, z_] := Block[{t$95$0 = N[Cosh[N[Abs[x], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[y], $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(t$95$0 * t$95$1), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision], 1e+296], N[(t$95$1 / N[Abs[z], $MachinePrecision]), $MachinePrecision], N[(N[Abs[y], $MachinePrecision] * N[(t$95$0 / N[(N[Abs[z], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \cosh \left(\left|x\right|\right)\\
t_1 := \frac{\left|y\right|}{\left|x\right|}\\
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
\mathbf{if}\;\frac{t\_0 \cdot t\_1}{\left|z\right|} \leq 10^{+296}:\\
\;\;\;\;\frac{t\_1}{\left|z\right|}\\
\mathbf{else}:\\
\;\;\;\;\left|y\right| \cdot \frac{t\_0}{\left|z\right| \cdot \left|x\right|}\\
\end{array}\right)\right)
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 9.9999999999999998e295Initial program 85.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6449.4%
Applied rewrites49.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6449.5%
Applied rewrites49.5%
if 9.9999999999999998e295 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 85.1%
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-/l/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6483.3%
Applied rewrites83.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (fabs y) (fabs x))))
(*
(copysign 1.0 x)
(*
(copysign 1.0 y)
(*
(copysign 1.0 z)
(if (<= (/ (* (cosh (fabs x)) t_0) (fabs z)) 1e+296)
(/ t_0 (fabs z))
(*
(/
(/
(+ (* 1.0 (fabs z)) (* (fabs z) 0.0))
(* (fabs z) (fabs z)))
(fabs x))
(fabs y))))))))double code(double x, double y, double z) {
double t_0 = fabs(y) / fabs(x);
double tmp;
if (((cosh(fabs(x)) * t_0) / fabs(z)) <= 1e+296) {
tmp = t_0 / fabs(z);
} else {
tmp = ((((1.0 * fabs(z)) + (fabs(z) * 0.0)) / (fabs(z) * fabs(z))) / fabs(x)) * fabs(y);
}
return copysign(1.0, x) * (copysign(1.0, y) * (copysign(1.0, z) * tmp));
}
public static double code(double x, double y, double z) {
double t_0 = Math.abs(y) / Math.abs(x);
double tmp;
if (((Math.cosh(Math.abs(x)) * t_0) / Math.abs(z)) <= 1e+296) {
tmp = t_0 / Math.abs(z);
} else {
tmp = ((((1.0 * Math.abs(z)) + (Math.abs(z) * 0.0)) / (Math.abs(z) * Math.abs(z))) / Math.abs(x)) * Math.abs(y);
}
return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * (Math.copySign(1.0, z) * tmp));
}
def code(x, y, z): t_0 = math.fabs(y) / math.fabs(x) tmp = 0 if ((math.cosh(math.fabs(x)) * t_0) / math.fabs(z)) <= 1e+296: tmp = t_0 / math.fabs(z) else: tmp = ((((1.0 * math.fabs(z)) + (math.fabs(z) * 0.0)) / (math.fabs(z) * math.fabs(z))) / math.fabs(x)) * math.fabs(y) return math.copysign(1.0, x) * (math.copysign(1.0, y) * (math.copysign(1.0, z) * tmp))
function code(x, y, z) t_0 = Float64(abs(y) / abs(x)) tmp = 0.0 if (Float64(Float64(cosh(abs(x)) * t_0) / abs(z)) <= 1e+296) tmp = Float64(t_0 / abs(z)); else tmp = Float64(Float64(Float64(Float64(Float64(1.0 * abs(z)) + Float64(abs(z) * 0.0)) / Float64(abs(z) * abs(z))) / abs(x)) * abs(y)); end return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * Float64(copysign(1.0, z) * tmp))) end
function tmp_2 = code(x, y, z) t_0 = abs(y) / abs(x); tmp = 0.0; if (((cosh(abs(x)) * t_0) / abs(z)) <= 1e+296) tmp = t_0 / abs(z); else tmp = ((((1.0 * abs(z)) + (abs(z) * 0.0)) / (abs(z) * abs(z))) / abs(x)) * abs(y); end tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * ((sign(z) * abs(1.0)) * tmp)); end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[y], $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(N[Cosh[N[Abs[x], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision], 1e+296], N[(t$95$0 / N[Abs[z], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(1.0 * N[Abs[z], $MachinePrecision]), $MachinePrecision] + N[(N[Abs[z], $MachinePrecision] * 0.0), $MachinePrecision]), $MachinePrecision] / N[(N[Abs[z], $MachinePrecision] * N[Abs[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[y], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
t_0 := \frac{\left|y\right|}{\left|x\right|}\\
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh \left(\left|x\right|\right) \cdot t\_0}{\left|z\right|} \leq 10^{+296}:\\
\;\;\;\;\frac{t\_0}{\left|z\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 \cdot \left|z\right| + \left|z\right| \cdot 0}{\left|z\right| \cdot \left|z\right|}}{\left|x\right|} \cdot \left|y\right|\\
\end{array}\right)\right)
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 9.9999999999999998e295Initial program 85.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6449.4%
Applied rewrites49.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6449.5%
Applied rewrites49.5%
if 9.9999999999999998e295 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 85.1%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lift-*.f64N/A
lift-cosh.f64N/A
cosh-defN/A
lift-/.f64N/A
frac-timesN/A
associate-*r/N/A
*-commutativeN/A
times-fracN/A
associate-*l/N/A
cosh-defN/A
lift-cosh.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6484.4%
Applied rewrites84.4%
Taylor expanded in x around 0
Applied rewrites49.0%
lift-/.f64N/A
metadata-evalN/A
div-addN/A
frac-addN/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6447.0%
Applied rewrites47.0%
(FPCore (x y z)
:precision binary64
(*
(copysign 1.0 x)
(*
(copysign 1.0 y)
(*
(copysign 1.0 z)
(if (<=
(/ (* (cosh (fabs x)) (/ (fabs y) (fabs x))) (fabs z))
2e-102)
(* (/ 1.0 (/ (fabs x) (fabs y))) (/ 1.0 (fabs z)))
(/ (/ (fabs y) (fabs z)) (fabs x)))))))double code(double x, double y, double z) {
double tmp;
if (((cosh(fabs(x)) * (fabs(y) / fabs(x))) / fabs(z)) <= 2e-102) {
tmp = (1.0 / (fabs(x) / fabs(y))) * (1.0 / fabs(z));
} else {
tmp = (fabs(y) / fabs(z)) / fabs(x);
}
return copysign(1.0, x) * (copysign(1.0, y) * (copysign(1.0, z) * tmp));
}
public static double code(double x, double y, double z) {
double tmp;
if (((Math.cosh(Math.abs(x)) * (Math.abs(y) / Math.abs(x))) / Math.abs(z)) <= 2e-102) {
tmp = (1.0 / (Math.abs(x) / Math.abs(y))) * (1.0 / Math.abs(z));
} else {
tmp = (Math.abs(y) / Math.abs(z)) / Math.abs(x);
}
return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * (Math.copySign(1.0, z) * tmp));
}
def code(x, y, z): tmp = 0 if ((math.cosh(math.fabs(x)) * (math.fabs(y) / math.fabs(x))) / math.fabs(z)) <= 2e-102: tmp = (1.0 / (math.fabs(x) / math.fabs(y))) * (1.0 / math.fabs(z)) else: tmp = (math.fabs(y) / math.fabs(z)) / math.fabs(x) return math.copysign(1.0, x) * (math.copysign(1.0, y) * (math.copysign(1.0, z) * tmp))
function code(x, y, z) tmp = 0.0 if (Float64(Float64(cosh(abs(x)) * Float64(abs(y) / abs(x))) / abs(z)) <= 2e-102) tmp = Float64(Float64(1.0 / Float64(abs(x) / abs(y))) * Float64(1.0 / abs(z))); else tmp = Float64(Float64(abs(y) / abs(z)) / abs(x)); end return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * Float64(copysign(1.0, z) * tmp))) end
function tmp_2 = code(x, y, z) tmp = 0.0; if (((cosh(abs(x)) * (abs(y) / abs(x))) / abs(z)) <= 2e-102) tmp = (1.0 / (abs(x) / abs(y))) * (1.0 / abs(z)); else tmp = (abs(y) / abs(z)) / abs(x); end tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * ((sign(z) * abs(1.0)) * tmp)); end
code[x_, y_, z_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(N[Cosh[N[Abs[x], $MachinePrecision]], $MachinePrecision] * N[(N[Abs[y], $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision], 2e-102], N[(N[(1.0 / N[(N[Abs[x], $MachinePrecision] / N[Abs[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Abs[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[y], $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh \left(\left|x\right|\right) \cdot \frac{\left|y\right|}{\left|x\right|}}{\left|z\right|} \leq 2 \cdot 10^{-102}:\\
\;\;\;\;\frac{1}{\frac{\left|x\right|}{\left|y\right|}} \cdot \frac{1}{\left|z\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left|y\right|}{\left|z\right|}}{\left|x\right|}\\
\end{array}\right)\right)
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 1.9999999999999999e-102Initial program 85.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6449.4%
Applied rewrites49.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
mult-flipN/A
lift-/.f64N/A
lower-*.f64N/A
lower-/.f6449.5%
Applied rewrites49.5%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6449.4%
Applied rewrites49.4%
if 1.9999999999999999e-102 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 85.1%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
mult-flip-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6496.2%
Applied rewrites96.2%
Taylor expanded in x around 0
Applied rewrites53.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (fabs y) (fabs x))))
(*
(copysign 1.0 x)
(*
(copysign 1.0 y)
(*
(copysign 1.0 z)
(if (<= (/ (* (cosh (fabs x)) t_0) (fabs z)) 4e+173)
(/ t_0 (fabs z))
(/ (/ (fabs y) (fabs z)) (fabs x))))))))double code(double x, double y, double z) {
double t_0 = fabs(y) / fabs(x);
double tmp;
if (((cosh(fabs(x)) * t_0) / fabs(z)) <= 4e+173) {
tmp = t_0 / fabs(z);
} else {
tmp = (fabs(y) / fabs(z)) / fabs(x);
}
return copysign(1.0, x) * (copysign(1.0, y) * (copysign(1.0, z) * tmp));
}
public static double code(double x, double y, double z) {
double t_0 = Math.abs(y) / Math.abs(x);
double tmp;
if (((Math.cosh(Math.abs(x)) * t_0) / Math.abs(z)) <= 4e+173) {
tmp = t_0 / Math.abs(z);
} else {
tmp = (Math.abs(y) / Math.abs(z)) / Math.abs(x);
}
return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * (Math.copySign(1.0, z) * tmp));
}
def code(x, y, z): t_0 = math.fabs(y) / math.fabs(x) tmp = 0 if ((math.cosh(math.fabs(x)) * t_0) / math.fabs(z)) <= 4e+173: tmp = t_0 / math.fabs(z) else: tmp = (math.fabs(y) / math.fabs(z)) / math.fabs(x) return math.copysign(1.0, x) * (math.copysign(1.0, y) * (math.copysign(1.0, z) * tmp))
function code(x, y, z) t_0 = Float64(abs(y) / abs(x)) tmp = 0.0 if (Float64(Float64(cosh(abs(x)) * t_0) / abs(z)) <= 4e+173) tmp = Float64(t_0 / abs(z)); else tmp = Float64(Float64(abs(y) / abs(z)) / abs(x)); end return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * Float64(copysign(1.0, z) * tmp))) end
function tmp_2 = code(x, y, z) t_0 = abs(y) / abs(x); tmp = 0.0; if (((cosh(abs(x)) * t_0) / abs(z)) <= 4e+173) tmp = t_0 / abs(z); else tmp = (abs(y) / abs(z)) / abs(x); end tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * ((sign(z) * abs(1.0)) * tmp)); end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[y], $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(N[Cosh[N[Abs[x], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision], 4e+173], N[(t$95$0 / N[Abs[z], $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[y], $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
t_0 := \frac{\left|y\right|}{\left|x\right|}\\
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh \left(\left|x\right|\right) \cdot t\_0}{\left|z\right|} \leq 4 \cdot 10^{+173}:\\
\;\;\;\;\frac{t\_0}{\left|z\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left|y\right|}{\left|z\right|}}{\left|x\right|}\\
\end{array}\right)\right)
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 4.0000000000000001e173Initial program 85.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6449.4%
Applied rewrites49.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6449.5%
Applied rewrites49.5%
if 4.0000000000000001e173 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 85.1%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
mult-flip-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6496.2%
Applied rewrites96.2%
Taylor expanded in x around 0
Applied rewrites53.6%
(FPCore (x y z)
:precision binary64
(*
(copysign 1.0 x)
(*
(copysign 1.0 y)
(*
(copysign 1.0 z)
(if (<=
(/ (* (cosh (fabs x)) (/ (fabs y) (fabs x))) (fabs z))
2e-102)
(/ 1.0 (* (/ (fabs x) (fabs y)) (fabs z)))
(/ (/ (fabs y) (fabs z)) (fabs x)))))))double code(double x, double y, double z) {
double tmp;
if (((cosh(fabs(x)) * (fabs(y) / fabs(x))) / fabs(z)) <= 2e-102) {
tmp = 1.0 / ((fabs(x) / fabs(y)) * fabs(z));
} else {
tmp = (fabs(y) / fabs(z)) / fabs(x);
}
return copysign(1.0, x) * (copysign(1.0, y) * (copysign(1.0, z) * tmp));
}
public static double code(double x, double y, double z) {
double tmp;
if (((Math.cosh(Math.abs(x)) * (Math.abs(y) / Math.abs(x))) / Math.abs(z)) <= 2e-102) {
tmp = 1.0 / ((Math.abs(x) / Math.abs(y)) * Math.abs(z));
} else {
tmp = (Math.abs(y) / Math.abs(z)) / Math.abs(x);
}
return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * (Math.copySign(1.0, z) * tmp));
}
def code(x, y, z): tmp = 0 if ((math.cosh(math.fabs(x)) * (math.fabs(y) / math.fabs(x))) / math.fabs(z)) <= 2e-102: tmp = 1.0 / ((math.fabs(x) / math.fabs(y)) * math.fabs(z)) else: tmp = (math.fabs(y) / math.fabs(z)) / math.fabs(x) return math.copysign(1.0, x) * (math.copysign(1.0, y) * (math.copysign(1.0, z) * tmp))
function code(x, y, z) tmp = 0.0 if (Float64(Float64(cosh(abs(x)) * Float64(abs(y) / abs(x))) / abs(z)) <= 2e-102) tmp = Float64(1.0 / Float64(Float64(abs(x) / abs(y)) * abs(z))); else tmp = Float64(Float64(abs(y) / abs(z)) / abs(x)); end return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * Float64(copysign(1.0, z) * tmp))) end
function tmp_2 = code(x, y, z) tmp = 0.0; if (((cosh(abs(x)) * (abs(y) / abs(x))) / abs(z)) <= 2e-102) tmp = 1.0 / ((abs(x) / abs(y)) * abs(z)); else tmp = (abs(y) / abs(z)) / abs(x); end tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * ((sign(z) * abs(1.0)) * tmp)); end
code[x_, y_, z_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(N[Cosh[N[Abs[x], $MachinePrecision]], $MachinePrecision] * N[(N[Abs[y], $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision], 2e-102], N[(1.0 / N[(N[(N[Abs[x], $MachinePrecision] / N[Abs[y], $MachinePrecision]), $MachinePrecision] * N[Abs[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[y], $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh \left(\left|x\right|\right) \cdot \frac{\left|y\right|}{\left|x\right|}}{\left|z\right|} \leq 2 \cdot 10^{-102}:\\
\;\;\;\;\frac{1}{\frac{\left|x\right|}{\left|y\right|} \cdot \left|z\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left|y\right|}{\left|z\right|}}{\left|x\right|}\\
\end{array}\right)\right)
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 1.9999999999999999e-102Initial program 85.1%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
mult-flip-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6496.2%
Applied rewrites96.2%
Taylor expanded in x around 0
Applied rewrites53.6%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6449.5%
Applied rewrites49.5%
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lift-/.f64N/A
div-flip-revN/A
lift-/.f64N/A
lift-/.f6453.5%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6449.7%
Applied rewrites49.7%
if 1.9999999999999999e-102 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 85.1%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
mult-flip-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6496.2%
Applied rewrites96.2%
Taylor expanded in x around 0
Applied rewrites53.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (fabs y) (fabs x))))
(*
(copysign 1.0 x)
(*
(copysign 1.0 y)
(*
(copysign 1.0 z)
(if (<= (/ (* (cosh (fabs x)) t_0) (fabs z)) 1e+296)
(/ t_0 (fabs z))
(/ (fabs y) (* (fabs x) (fabs z)))))))))double code(double x, double y, double z) {
double t_0 = fabs(y) / fabs(x);
double tmp;
if (((cosh(fabs(x)) * t_0) / fabs(z)) <= 1e+296) {
tmp = t_0 / fabs(z);
} else {
tmp = fabs(y) / (fabs(x) * fabs(z));
}
return copysign(1.0, x) * (copysign(1.0, y) * (copysign(1.0, z) * tmp));
}
public static double code(double x, double y, double z) {
double t_0 = Math.abs(y) / Math.abs(x);
double tmp;
if (((Math.cosh(Math.abs(x)) * t_0) / Math.abs(z)) <= 1e+296) {
tmp = t_0 / Math.abs(z);
} else {
tmp = Math.abs(y) / (Math.abs(x) * Math.abs(z));
}
return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * (Math.copySign(1.0, z) * tmp));
}
def code(x, y, z): t_0 = math.fabs(y) / math.fabs(x) tmp = 0 if ((math.cosh(math.fabs(x)) * t_0) / math.fabs(z)) <= 1e+296: tmp = t_0 / math.fabs(z) else: tmp = math.fabs(y) / (math.fabs(x) * math.fabs(z)) return math.copysign(1.0, x) * (math.copysign(1.0, y) * (math.copysign(1.0, z) * tmp))
function code(x, y, z) t_0 = Float64(abs(y) / abs(x)) tmp = 0.0 if (Float64(Float64(cosh(abs(x)) * t_0) / abs(z)) <= 1e+296) tmp = Float64(t_0 / abs(z)); else tmp = Float64(abs(y) / Float64(abs(x) * abs(z))); end return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * Float64(copysign(1.0, z) * tmp))) end
function tmp_2 = code(x, y, z) t_0 = abs(y) / abs(x); tmp = 0.0; if (((cosh(abs(x)) * t_0) / abs(z)) <= 1e+296) tmp = t_0 / abs(z); else tmp = abs(y) / (abs(x) * abs(z)); end tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * ((sign(z) * abs(1.0)) * tmp)); end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[y], $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(N[Cosh[N[Abs[x], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision], 1e+296], N[(t$95$0 / N[Abs[z], $MachinePrecision]), $MachinePrecision], N[(N[Abs[y], $MachinePrecision] / N[(N[Abs[x], $MachinePrecision] * N[Abs[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
t_0 := \frac{\left|y\right|}{\left|x\right|}\\
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh \left(\left|x\right|\right) \cdot t\_0}{\left|z\right|} \leq 10^{+296}:\\
\;\;\;\;\frac{t\_0}{\left|z\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left|y\right|}{\left|x\right| \cdot \left|z\right|}\\
\end{array}\right)\right)
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 9.9999999999999998e295Initial program 85.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6449.4%
Applied rewrites49.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6449.5%
Applied rewrites49.5%
if 9.9999999999999998e295 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 85.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6449.4%
Applied rewrites49.4%
(FPCore (x y z) :precision binary64 (/ y (* x z)))
double code(double x, double y, double z) {
return y / (x * z);
}
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, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y / (x * z)
end function
public static double code(double x, double y, double z) {
return y / (x * z);
}
def code(x, y, z): return y / (x * z)
function code(x, y, z) return Float64(y / Float64(x * z)) end
function tmp = code(x, y, z) tmp = y / (x * z); end
code[x_, y_, z_] := N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]
\frac{y}{x \cdot z}
Initial program 85.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6449.4%
Applied rewrites49.4%
herbie shell --seed 2025258
(FPCore (x y z)
:name "Linear.Quaternion:$ctan from linear-1.19.1.3"
:precision binary64
(/ (* (cosh x) (/ y x)) z))