
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
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, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
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, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (/ y t) b (- a -1.0)))
(t_2 (fma (/ y t) (/ z t_1) (/ x t_1))))
(if (<= t -70000000000.0)
t_2
(if (<= t 6.5e-11) (/ (fma t x (* z y)) (fma a t (fma b y t))) t_2))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((y / t), b, (a - -1.0));
double t_2 = fma((y / t), (z / t_1), (x / t_1));
double tmp;
if (t <= -70000000000.0) {
tmp = t_2;
} else if (t <= 6.5e-11) {
tmp = fma(t, x, (z * y)) / fma(a, t, fma(b, y, t));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(y / t), b, Float64(a - -1.0)) t_2 = fma(Float64(y / t), Float64(z / t_1), Float64(x / t_1)) tmp = 0.0 if (t <= -70000000000.0) tmp = t_2; elseif (t <= 6.5e-11) tmp = Float64(fma(t, x, Float64(z * y)) / fma(a, t, fma(b, y, t))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y / t), $MachinePrecision] * b + N[(a - -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / t), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision] + N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -70000000000.0], t$95$2, If[LessEqual[t, 6.5e-11], N[(N[(t * x + N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)\\
t_2 := \mathsf{fma}\left(\frac{y}{t}, \frac{z}{t\_1}, \frac{x}{t\_1}\right)\\
\mathbf{if}\;t \leq -70000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-11}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, x, z \cdot y\right)}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if t < -7e10 or 6.4999999999999995e-11 < t Initial program 74.6%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
+-commutativeN/A
lift-/.f64N/A
associate-/l/N/A
lift-*.f64N/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites78.1%
if -7e10 < t < 6.4999999999999995e-11Initial program 74.6%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6464.1%
lower-unsound-/.f64N/A
*-lft-identityN/A
lower-unsound-+.f64N/A
Applied rewrites69.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma (/ y t) z x) (fma (/ y t) b (- a -1.0)))))
(if (<= t -80000000000.0)
t_1
(if (<= t 2.5e-35) (/ (fma t x (* z y)) (fma a t (fma b y t))) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((y / t), z, x) / fma((y / t), b, (a - -1.0));
double tmp;
if (t <= -80000000000.0) {
tmp = t_1;
} else if (t <= 2.5e-35) {
tmp = fma(t, x, (z * y)) / fma(a, t, fma(b, y, t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(Float64(y / t), z, x) / fma(Float64(y / t), b, Float64(a - -1.0))) tmp = 0.0 if (t <= -80000000000.0) tmp = t_1; elseif (t <= 2.5e-35) tmp = Float64(fma(t, x, Float64(z * y)) / fma(a, t, fma(b, y, t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y / t), $MachinePrecision] * z + x), $MachinePrecision] / N[(N[(y / t), $MachinePrecision] * b + N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -80000000000.0], t$95$1, If[LessEqual[t, 2.5e-35], N[(N[(t * x + N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{\mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)}\\
\mathbf{if}\;t \leq -80000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-35}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, x, z \cdot y\right)}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -8e10 or 2.4999999999999998e-35 < t Initial program 74.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6474.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.3%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-eval76.3%
Applied rewrites76.3%
if -8e10 < t < 2.4999999999999998e-35Initial program 74.6%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6464.1%
lower-unsound-/.f64N/A
*-lft-identityN/A
lower-unsound-+.f64N/A
Applied rewrites69.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (/ y t) (/ z (- a -1.0)) (/ x (- a -1.0)))))
(if (<= t -1.9e+97)
t_1
(if (<= t 8.5e+51) (/ (fma t x (* z y)) (fma a t (fma b y t))) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((y / t), (z / (a - -1.0)), (x / (a - -1.0)));
double tmp;
if (t <= -1.9e+97) {
tmp = t_1;
} else if (t <= 8.5e+51) {
tmp = fma(t, x, (z * y)) / fma(a, t, fma(b, y, t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(y / t), Float64(z / Float64(a - -1.0)), Float64(x / Float64(a - -1.0))) tmp = 0.0 if (t <= -1.9e+97) tmp = t_1; elseif (t <= 8.5e+51) tmp = Float64(fma(t, x, Float64(z * y)) / fma(a, t, fma(b, y, t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y / t), $MachinePrecision] * N[(z / N[(a - -1.0), $MachinePrecision]), $MachinePrecision] + N[(x / N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.9e+97], t$95$1, If[LessEqual[t, 8.5e+51], N[(N[(t * x + N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{t}, \frac{z}{a - -1}, \frac{x}{a - -1}\right)\\
\mathbf{if}\;t \leq -1.9 \cdot 10^{+97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+51}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, x, z \cdot y\right)}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1.9000000000000002e97 or 8.4999999999999999e51 < t Initial program 74.6%
Taylor expanded in y around 0
lower-+.f6456.0%
Applied rewrites56.0%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites58.4%
if -1.9000000000000002e97 < t < 8.4999999999999999e51Initial program 74.6%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6464.1%
lower-unsound-/.f64N/A
*-lft-identityN/A
lower-unsound-+.f64N/A
Applied rewrites69.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(t_2 (/ (* y z) (fma a t (fma b y t)))))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 -5e-316)
(/ (fma (/ 1.0 t) (* z y) x) (+ 1.0 a))
(if (<= t_1 0.0)
t_2
(if (<= t_1 5e+306) (/ (fma z (/ y t) x) (- a -1.0)) (/ z b)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double t_2 = (y * z) / fma(a, t, fma(b, y, t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= -5e-316) {
tmp = fma((1.0 / t), (z * y), x) / (1.0 + a);
} else if (t_1 <= 0.0) {
tmp = t_2;
} else if (t_1 <= 5e+306) {
tmp = fma(z, (y / t), x) / (a - -1.0);
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_2 = Float64(Float64(y * z) / fma(a, t, fma(b, y, t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= -5e-316) tmp = Float64(fma(Float64(1.0 / t), Float64(z * y), x) / Float64(1.0 + a)); elseif (t_1 <= 0.0) tmp = t_2; elseif (t_1 <= 5e+306) tmp = Float64(fma(z, Float64(y / t), x) / Float64(a - -1.0)); else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * z), $MachinePrecision] / N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -5e-316], N[(N[(N[(1.0 / t), $MachinePrecision] * N[(z * y), $MachinePrecision] + x), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], t$95$2, If[LessEqual[t$95$1, 5e+306], N[(N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision] / N[(a - -1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_2 := \frac{y \cdot z}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-316}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{t}, z \cdot y, x\right)}{1 + a}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{a - -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0 or -5.0000000171117013e-316 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0Initial program 74.6%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6464.1%
lower-unsound-/.f64N/A
*-lft-identityN/A
lower-unsound-+.f64N/A
Applied rewrites69.7%
Taylor expanded in x around 0
lower-*.f6442.1%
Applied rewrites42.1%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.0000000171117013e-316Initial program 74.6%
Taylor expanded in y around 0
lower-+.f6456.0%
Applied rewrites56.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6456.0%
Applied rewrites56.0%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.9999999999999999e306Initial program 74.6%
Taylor expanded in y around 0
lower-+.f6456.0%
Applied rewrites56.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f6457.8%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f6457.8%
Applied rewrites57.8%
if 4.9999999999999999e306 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 74.6%
Taylor expanded in y around inf
lower-/.f6434.4%
Applied rewrites34.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t)))
(t_2 (/ t_1 (+ (+ a 1.0) (/ (* y b) t))))
(t_3 (/ (* y z) (fma a t (fma b y t)))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 -5e-316)
(/ t_1 (+ 1.0 a))
(if (<= t_2 0.0)
t_3
(if (<= t_2 5e+306) (/ (fma z (/ y t) x) (- a -1.0)) (/ z b)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double t_3 = (y * z) / fma(a, t, fma(b, y, t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= -5e-316) {
tmp = t_1 / (1.0 + a);
} else if (t_2 <= 0.0) {
tmp = t_3;
} else if (t_2 <= 5e+306) {
tmp = fma(z, (y / t), x) / (a - -1.0);
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) t_2 = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_3 = Float64(Float64(y * z) / fma(a, t, fma(b, y, t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= -5e-316) tmp = Float64(t_1 / Float64(1.0 + a)); elseif (t_2 <= 0.0) tmp = t_3; elseif (t_2 <= 5e+306) tmp = Float64(fma(z, Float64(y / t), x) / Float64(a - -1.0)); else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * z), $MachinePrecision] / N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -5e-316], N[(t$95$1 / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], t$95$3, If[LessEqual[t$95$2, 5e+306], N[(N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision] / N[(a - -1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t\_1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_3 := \frac{y \cdot z}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-316}:\\
\;\;\;\;\frac{t\_1}{1 + a}\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{a - -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0 or -5.0000000171117013e-316 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0Initial program 74.6%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6464.1%
lower-unsound-/.f64N/A
*-lft-identityN/A
lower-unsound-+.f64N/A
Applied rewrites69.7%
Taylor expanded in x around 0
lower-*.f6442.1%
Applied rewrites42.1%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.0000000171117013e-316Initial program 74.6%
Taylor expanded in y around 0
lower-+.f6456.0%
Applied rewrites56.0%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.9999999999999999e306Initial program 74.6%
Taylor expanded in y around 0
lower-+.f6456.0%
Applied rewrites56.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f6457.8%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f6457.8%
Applied rewrites57.8%
if 4.9999999999999999e306 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 74.6%
Taylor expanded in y around inf
lower-/.f6434.4%
Applied rewrites34.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(t_2 (fma (/ y t) (/ z (- a -1.0)) (/ x (- a -1.0)))))
(if (<= t_1 -5e-316)
t_2
(if (<= t_1 5e-322)
(/ (* y z) (fma a t (fma b y t)))
(if (<= t_1 5e+306) t_2 (/ z b))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double t_2 = fma((y / t), (z / (a - -1.0)), (x / (a - -1.0)));
double tmp;
if (t_1 <= -5e-316) {
tmp = t_2;
} else if (t_1 <= 5e-322) {
tmp = (y * z) / fma(a, t, fma(b, y, t));
} else if (t_1 <= 5e+306) {
tmp = t_2;
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_2 = fma(Float64(y / t), Float64(z / Float64(a - -1.0)), Float64(x / Float64(a - -1.0))) tmp = 0.0 if (t_1 <= -5e-316) tmp = t_2; elseif (t_1 <= 5e-322) tmp = Float64(Float64(y * z) / fma(a, t, fma(b, y, t))); elseif (t_1 <= 5e+306) tmp = t_2; else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / t), $MachinePrecision] * N[(z / N[(a - -1.0), $MachinePrecision]), $MachinePrecision] + N[(x / N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-316], t$95$2, If[LessEqual[t$95$1, 5e-322], N[(N[(y * z), $MachinePrecision] / N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+306], t$95$2, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_2 := \mathsf{fma}\left(\frac{y}{t}, \frac{z}{a - -1}, \frac{x}{a - -1}\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-316}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-322}:\\
\;\;\;\;\frac{y \cdot z}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.0000000171117013e-316 or 4.9900630229965901e-322 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.9999999999999999e306Initial program 74.6%
Taylor expanded in y around 0
lower-+.f6456.0%
Applied rewrites56.0%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites58.4%
if -5.0000000171117013e-316 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.9900630229965901e-322Initial program 74.6%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6464.1%
lower-unsound-/.f64N/A
*-lft-identityN/A
lower-unsound-+.f64N/A
Applied rewrites69.7%
Taylor expanded in x around 0
lower-*.f6442.1%
Applied rewrites42.1%
if 4.9999999999999999e306 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 74.6%
Taylor expanded in y around inf
lower-/.f6434.4%
Applied rewrites34.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1.2e-43)
(/ (fma (/ z t) y x) (- a -1.0))
(if (<= t 1.58e-18)
(/ (+ z (/ (* t x) y)) b)
(/ (fma z (/ y t) x) (- a -1.0)))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.2e-43) {
tmp = fma((z / t), y, x) / (a - -1.0);
} else if (t <= 1.58e-18) {
tmp = (z + ((t * x) / y)) / b;
} else {
tmp = fma(z, (y / t), x) / (a - -1.0);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.2e-43) tmp = Float64(fma(Float64(z / t), y, x) / Float64(a - -1.0)); elseif (t <= 1.58e-18) tmp = Float64(Float64(z + Float64(Float64(t * x) / y)) / b); else tmp = Float64(fma(z, Float64(y / t), x) / Float64(a - -1.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.2e-43], N[(N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision] / N[(a - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.58e-18], N[(N[(z + N[(N[(t * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision] / N[(a - -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{-43}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{z}{t}, y, x\right)}{a - -1}\\
\mathbf{elif}\;t \leq 1.58 \cdot 10^{-18}:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{a - -1}\\
\end{array}
if t < -1.2000000000000001e-43Initial program 74.6%
Taylor expanded in y around 0
lower-+.f6456.0%
Applied rewrites56.0%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-/l/N/A
lift-*.f64N/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites56.2%
lift-fma.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
associate-*r/N/A
div-add-revN/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites56.2%
if -1.2000000000000001e-43 < t < 1.5800000000000001e-18Initial program 74.6%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
+-commutativeN/A
lift-/.f64N/A
associate-/l/N/A
lift-*.f64N/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites78.1%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.8%
Applied rewrites40.8%
if 1.5800000000000001e-18 < t Initial program 74.6%
Taylor expanded in y around 0
lower-+.f6456.0%
Applied rewrites56.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f6457.8%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f6457.8%
Applied rewrites57.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma z (/ y t) x) (- a -1.0))))
(if (<= t -1.2e-43)
t_1
(if (<= t 1.58e-18) (/ (+ z (/ (* t x) y)) b) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (y / t), x) / (a - -1.0);
double tmp;
if (t <= -1.2e-43) {
tmp = t_1;
} else if (t <= 1.58e-18) {
tmp = (z + ((t * x) / y)) / b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(z, Float64(y / t), x) / Float64(a - -1.0)) tmp = 0.0 if (t <= -1.2e-43) tmp = t_1; elseif (t <= 1.58e-18) tmp = Float64(Float64(z + Float64(Float64(t * x) / y)) / b); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision] / N[(a - -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.2e-43], t$95$1, If[LessEqual[t, 1.58e-18], N[(N[(z + N[(N[(t * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{a - -1}\\
\mathbf{if}\;t \leq -1.2 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.58 \cdot 10^{-18}:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1.2000000000000001e-43 or 1.5800000000000001e-18 < t Initial program 74.6%
Taylor expanded in y around 0
lower-+.f6456.0%
Applied rewrites56.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f6457.8%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f6457.8%
Applied rewrites57.8%
if -1.2000000000000001e-43 < t < 1.5800000000000001e-18Initial program 74.6%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
+-commutativeN/A
lift-/.f64N/A
associate-/l/N/A
lift-*.f64N/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites78.1%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.8%
Applied rewrites40.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 (- INFINITY))
(/ z b)
(if (<= t_1 5e+306) (/ x (fma (/ y t) b (- a -1.0))) (/ z b)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = z / b;
} else if (t_1 <= 5e+306) {
tmp = x / fma((y / t), b, (a - -1.0));
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(z / b); elseif (t_1 <= 5e+306) tmp = Float64(x / fma(Float64(y / t), b, Float64(a - -1.0))); else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z / b), $MachinePrecision], If[LessEqual[t$95$1, 5e+306], N[(x / N[(N[(y / t), $MachinePrecision] * b + N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0 or 4.9999999999999999e306 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 74.6%
Taylor expanded in y around inf
lower-/.f6434.4%
Applied rewrites34.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.9999999999999999e306Initial program 74.6%
Taylor expanded in x around inf
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6451.9%
Applied rewrites51.9%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
add-flipN/A
+-commutativeN/A
lift-+.f64N/A
sub-flip-reverseN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
sub-negate-revN/A
add-flipN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lift--.f6453.3%
Applied rewrites53.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.2e-43) (/ x (* (- 1.0 (/ -1.0 a)) a)) (if (<= t 1.5e+52) (/ (+ z (/ (* t x) y)) b) (/ x (- a -1.0)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.2e-43) {
tmp = x / ((1.0 - (-1.0 / a)) * a);
} else if (t <= 1.5e+52) {
tmp = (z + ((t * x) / y)) / b;
} else {
tmp = x / (a - -1.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, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.2d-43)) then
tmp = x / ((1.0d0 - ((-1.0d0) / a)) * a)
else if (t <= 1.5d+52) then
tmp = (z + ((t * x) / y)) / b
else
tmp = x / (a - (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.2e-43) {
tmp = x / ((1.0 - (-1.0 / a)) * a);
} else if (t <= 1.5e+52) {
tmp = (z + ((t * x) / y)) / b;
} else {
tmp = x / (a - -1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.2e-43: tmp = x / ((1.0 - (-1.0 / a)) * a) elif t <= 1.5e+52: tmp = (z + ((t * x) / y)) / b else: tmp = x / (a - -1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.2e-43) tmp = Float64(x / Float64(Float64(1.0 - Float64(-1.0 / a)) * a)); elseif (t <= 1.5e+52) tmp = Float64(Float64(z + Float64(Float64(t * x) / y)) / b); else tmp = Float64(x / Float64(a - -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.2e-43) tmp = x / ((1.0 - (-1.0 / a)) * a); elseif (t <= 1.5e+52) tmp = (z + ((t * x) / y)) / b; else tmp = x / (a - -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.2e-43], N[(x / N[(N[(1.0 - N[(-1.0 / a), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e+52], N[(N[(z + N[(N[(t * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(x / N[(a - -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(1 - \frac{-1}{a}\right) \cdot a}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{+52}:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a - -1}\\
\end{array}
if t < -1.2000000000000001e-43Initial program 74.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6441.9%
Applied rewrites41.9%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f6441.8%
Applied rewrites41.8%
if -1.2000000000000001e-43 < t < 1.5e52Initial program 74.6%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
+-commutativeN/A
lift-/.f64N/A
associate-/l/N/A
lift-*.f64N/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites78.1%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6440.8%
Applied rewrites40.8%
if 1.5e52 < t Initial program 74.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6441.9%
Applied rewrites41.9%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f6441.9%
Applied rewrites41.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.2e-43) (/ x (* (- 1.0 (/ -1.0 a)) a)) (if (<= t 2.6e+52) (/ z b) (/ x (- a -1.0)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.2e-43) {
tmp = x / ((1.0 - (-1.0 / a)) * a);
} else if (t <= 2.6e+52) {
tmp = z / b;
} else {
tmp = x / (a - -1.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, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.2d-43)) then
tmp = x / ((1.0d0 - ((-1.0d0) / a)) * a)
else if (t <= 2.6d+52) then
tmp = z / b
else
tmp = x / (a - (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.2e-43) {
tmp = x / ((1.0 - (-1.0 / a)) * a);
} else if (t <= 2.6e+52) {
tmp = z / b;
} else {
tmp = x / (a - -1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.2e-43: tmp = x / ((1.0 - (-1.0 / a)) * a) elif t <= 2.6e+52: tmp = z / b else: tmp = x / (a - -1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.2e-43) tmp = Float64(x / Float64(Float64(1.0 - Float64(-1.0 / a)) * a)); elseif (t <= 2.6e+52) tmp = Float64(z / b); else tmp = Float64(x / Float64(a - -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.2e-43) tmp = x / ((1.0 - (-1.0 / a)) * a); elseif (t <= 2.6e+52) tmp = z / b; else tmp = x / (a - -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.2e-43], N[(x / N[(N[(1.0 - N[(-1.0 / a), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.6e+52], N[(z / b), $MachinePrecision], N[(x / N[(a - -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(1 - \frac{-1}{a}\right) \cdot a}\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+52}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a - -1}\\
\end{array}
if t < -1.2000000000000001e-43Initial program 74.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6441.9%
Applied rewrites41.9%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
sub-to-multN/A
lower-unsound-*.f64N/A
lower-unsound--.f64N/A
lower-unsound-/.f6441.8%
Applied rewrites41.8%
if -1.2000000000000001e-43 < t < 2.6e52Initial program 74.6%
Taylor expanded in y around inf
lower-/.f6434.4%
Applied rewrites34.4%
if 2.6e52 < t Initial program 74.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6441.9%
Applied rewrites41.9%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f6441.9%
Applied rewrites41.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- a -1.0)))) (if (<= t -1.2e-43) t_1 (if (<= t 2.6e+52) (/ z b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a - -1.0);
double tmp;
if (t <= -1.2e-43) {
tmp = t_1;
} else if (t <= 2.6e+52) {
tmp = z / b;
} else {
tmp = 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, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (a - (-1.0d0))
if (t <= (-1.2d-43)) then
tmp = t_1
else if (t <= 2.6d+52) then
tmp = z / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a - -1.0);
double tmp;
if (t <= -1.2e-43) {
tmp = t_1;
} else if (t <= 2.6e+52) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a - -1.0) tmp = 0 if t <= -1.2e-43: tmp = t_1 elif t <= 2.6e+52: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a - -1.0)) tmp = 0.0 if (t <= -1.2e-43) tmp = t_1; elseif (t <= 2.6e+52) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (a - -1.0); tmp = 0.0; if (t <= -1.2e-43) tmp = t_1; elseif (t <= 2.6e+52) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a - -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.2e-43], t$95$1, If[LessEqual[t, 2.6e+52], N[(z / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x}{a - -1}\\
\mathbf{if}\;t \leq -1.2 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+52}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1.2000000000000001e-43 or 2.6e52 < t Initial program 74.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6441.9%
Applied rewrites41.9%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f6441.9%
Applied rewrites41.9%
if -1.2000000000000001e-43 < t < 2.6e52Initial program 74.6%
Taylor expanded in y around inf
lower-/.f6434.4%
Applied rewrites34.4%
(FPCore (x y z t a b) :precision binary64 (if (<= a -2.05e+27) (/ x a) (if (<= a 4.4e+15) (/ z b) (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.05e+27) {
tmp = x / a;
} else if (a <= 4.4e+15) {
tmp = z / b;
} else {
tmp = x / a;
}
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, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-2.05d+27)) then
tmp = x / a
else if (a <= 4.4d+15) then
tmp = z / b
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.05e+27) {
tmp = x / a;
} else if (a <= 4.4e+15) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.05e+27: tmp = x / a elif a <= 4.4e+15: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.05e+27) tmp = Float64(x / a); elseif (a <= 4.4e+15) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.05e+27) tmp = x / a; elseif (a <= 4.4e+15) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.05e+27], N[(x / a), $MachinePrecision], If[LessEqual[a, 4.4e+15], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;a \leq -2.05 \cdot 10^{+27}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 4.4 \cdot 10^{+15}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
if a < -2.0500000000000001e27 or 4.4e15 < a Initial program 74.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6441.9%
Applied rewrites41.9%
Taylor expanded in a around inf
lower-/.f6425.6%
Applied rewrites25.6%
if -2.0500000000000001e27 < a < 4.4e15Initial program 74.6%
Taylor expanded in y around inf
lower-/.f6434.4%
Applied rewrites34.4%
(FPCore (x y z t a b) :precision binary64 (if (<= a -2.05e+27) (/ x a) (if (<= a 460000000000.0) (/ x 1.0) (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.05e+27) {
tmp = x / a;
} else if (a <= 460000000000.0) {
tmp = x / 1.0;
} else {
tmp = x / a;
}
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, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-2.05d+27)) then
tmp = x / a
else if (a <= 460000000000.0d0) then
tmp = x / 1.0d0
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.05e+27) {
tmp = x / a;
} else if (a <= 460000000000.0) {
tmp = x / 1.0;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.05e+27: tmp = x / a elif a <= 460000000000.0: tmp = x / 1.0 else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.05e+27) tmp = Float64(x / a); elseif (a <= 460000000000.0) tmp = Float64(x / 1.0); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.05e+27) tmp = x / a; elseif (a <= 460000000000.0) tmp = x / 1.0; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.05e+27], N[(x / a), $MachinePrecision], If[LessEqual[a, 460000000000.0], N[(x / 1.0), $MachinePrecision], N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;a \leq -2.05 \cdot 10^{+27}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 460000000000:\\
\;\;\;\;\frac{x}{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
if a < -2.0500000000000001e27 or 4.6e11 < a Initial program 74.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6441.9%
Applied rewrites41.9%
Taylor expanded in a around inf
lower-/.f6425.6%
Applied rewrites25.6%
if -2.0500000000000001e27 < a < 4.6e11Initial program 74.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6441.9%
Applied rewrites41.9%
Taylor expanded in a around 0
Applied rewrites19.4%
(FPCore (x y z t a b) :precision binary64 (/ x a))
double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
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, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x / a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
def code(x, y, z, t, a, b): return x / a
function code(x, y, z, t, a, b) return Float64(x / a) end
function tmp = code(x, y, z, t, a, b) tmp = x / a; end
code[x_, y_, z_, t_, a_, b_] := N[(x / a), $MachinePrecision]
\frac{x}{a}
Initial program 74.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6441.9%
Applied rewrites41.9%
Taylor expanded in a around inf
lower-/.f6425.6%
Applied rewrites25.6%
herbie shell --seed 2025188
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))