
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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
code = ((x * y) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a): return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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
code = ((x * y) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a): return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (fabs a) (fabs a))))
(*
(copysign 1.0 a)
(if (<= (fabs a) 4e+80)
(/ (fma (* -9.0 t) z (* (fmax x y) (fmin x y))) t_1)
(fma (/ z (fabs a)) (* -4.5 t) (* (/ (fmin x y) t_1) (fmax x y)))))))double code(double x, double y, double z, double t, double a) {
double t_1 = fabs(a) + fabs(a);
double tmp;
if (fabs(a) <= 4e+80) {
tmp = fma((-9.0 * t), z, (fmax(x, y) * fmin(x, y))) / t_1;
} else {
tmp = fma((z / fabs(a)), (-4.5 * t), ((fmin(x, y) / t_1) * fmax(x, y)));
}
return copysign(1.0, a) * tmp;
}
function code(x, y, z, t, a) t_1 = Float64(abs(a) + abs(a)) tmp = 0.0 if (abs(a) <= 4e+80) tmp = Float64(fma(Float64(-9.0 * t), z, Float64(fmax(x, y) * fmin(x, y))) / t_1); else tmp = fma(Float64(z / abs(a)), Float64(-4.5 * t), Float64(Float64(fmin(x, y) / t_1) * fmax(x, y))); end return Float64(copysign(1.0, a) * tmp) end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Abs[a], $MachinePrecision] + N[Abs[a], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[a], $MachinePrecision], 4e+80], N[(N[(N[(-9.0 * t), $MachinePrecision] * z + N[(N[Max[x, y], $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(z / N[Abs[a], $MachinePrecision]), $MachinePrecision] * N[(-4.5 * t), $MachinePrecision] + N[(N[(N[Min[x, y], $MachinePrecision] / t$95$1), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_1 := \left|a\right| + \left|a\right|\\
\mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|a\right| \leq 4 \cdot 10^{+80}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-9 \cdot t, z, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right)\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{\left|a\right|}, -4.5 \cdot t, \frac{\mathsf{min}\left(x, y\right)}{t\_1} \cdot \mathsf{max}\left(x, y\right)\right)\\
\end{array}
\end{array}
if a < 4e80Initial program 91.5%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval91.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6491.8%
Applied rewrites91.8%
lift-*.f64N/A
*-commutativeN/A
count-2N/A
lift-+.f6491.8%
Applied rewrites91.8%
if 4e80 < a Initial program 91.5%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval91.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6491.8%
Applied rewrites91.8%
Applied rewrites87.5%
(FPCore (x y z t a) :precision binary64 (if (<= (* (fmin x y) (fmax x y)) 1e+231) (/ (fma (* -9.0 t) z (* (fmax x y) (fmin x y))) (+ a a)) (* (fmax x y) (/ (fmin x y) (+ a a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((fmin(x, y) * fmax(x, y)) <= 1e+231) {
tmp = fma((-9.0 * t), z, (fmax(x, y) * fmin(x, y))) / (a + a);
} else {
tmp = fmax(x, y) * (fmin(x, y) / (a + a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(fmin(x, y) * fmax(x, y)) <= 1e+231) tmp = Float64(fma(Float64(-9.0 * t), z, Float64(fmax(x, y) * fmin(x, y))) / Float64(a + a)); else tmp = Float64(fmax(x, y) * Float64(fmin(x, y) / Float64(a + a))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision], 1e+231], N[(N[(N[(-9.0 * t), $MachinePrecision] * z + N[(N[Max[x, y], $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision], N[(N[Max[x, y], $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right) \leq 10^{+231}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-9 \cdot t, z, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right)\right)}{a + a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x, y\right) \cdot \frac{\mathsf{min}\left(x, y\right)}{a + a}\\
\end{array}
if (*.f64 x y) < 1.0000000000000001e231Initial program 91.5%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval91.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6491.8%
Applied rewrites91.8%
lift-*.f64N/A
*-commutativeN/A
count-2N/A
lift-+.f6491.8%
Applied rewrites91.8%
if 1.0000000000000001e231 < (*.f64 x y) Initial program 91.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6451.0%
Applied rewrites51.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
*-rgt-identityN/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
count-2N/A
lift-+.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6451.0%
Applied rewrites51.0%
(FPCore (x y z t a) :precision binary64 (if (<= (* (fmin x y) (fmax x y)) 1e+231) (/ (fma (fmax x y) (fmin x y) (* (* z -9.0) t)) (+ a a)) (* (fmax x y) (/ (fmin x y) (+ a a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((fmin(x, y) * fmax(x, y)) <= 1e+231) {
tmp = fma(fmax(x, y), fmin(x, y), ((z * -9.0) * t)) / (a + a);
} else {
tmp = fmax(x, y) * (fmin(x, y) / (a + a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(fmin(x, y) * fmax(x, y)) <= 1e+231) tmp = Float64(fma(fmax(x, y), fmin(x, y), Float64(Float64(z * -9.0) * t)) / Float64(a + a)); else tmp = Float64(fmax(x, y) * Float64(fmin(x, y) / Float64(a + a))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision], 1e+231], N[(N[(N[Max[x, y], $MachinePrecision] * N[Min[x, y], $MachinePrecision] + N[(N[(z * -9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision], N[(N[Max[x, y], $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right) \leq 10^{+231}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{max}\left(x, y\right), \mathsf{min}\left(x, y\right), \left(z \cdot -9\right) \cdot t\right)}{a + a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x, y\right) \cdot \frac{\mathsf{min}\left(x, y\right)}{a + a}\\
\end{array}
if (*.f64 x y) < 1.0000000000000001e231Initial program 91.5%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval91.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6491.8%
Applied rewrites91.8%
lift-*.f64N/A
*-commutativeN/A
count-2N/A
lift-+.f6491.8%
Applied rewrites91.8%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
lift-*.f64N/A
metadata-evalN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
remove-double-negN/A
distribute-lft-neg-inN/A
associate-*r*N/A
distribute-rgt-neg-outN/A
metadata-evalN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
remove-double-negN/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites91.7%
if 1.0000000000000001e231 < (*.f64 x y) Initial program 91.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6451.0%
Applied rewrites51.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
*-rgt-identityN/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
count-2N/A
lift-+.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6451.0%
Applied rewrites51.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* -4.5 (fmax z t))) (t_2 (* (* (fmin z t) 9.0) (fmax z t))))
(if (<= t_2 -2e+21)
(* (/ (fmin z t) a) t_1)
(if (<= t_2 1e+23) (/ (* x y) (+ a a)) (* (fmin z t) (/ t_1 a))))))double code(double x, double y, double z, double t, double a) {
double t_1 = -4.5 * fmax(z, t);
double t_2 = (fmin(z, t) * 9.0) * fmax(z, t);
double tmp;
if (t_2 <= -2e+21) {
tmp = (fmin(z, t) / a) * t_1;
} else if (t_2 <= 1e+23) {
tmp = (x * y) / (a + a);
} else {
tmp = fmin(z, t) * (t_1 / 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)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-4.5d0) * fmax(z, t)
t_2 = (fmin(z, t) * 9.0d0) * fmax(z, t)
if (t_2 <= (-2d+21)) then
tmp = (fmin(z, t) / a) * t_1
else if (t_2 <= 1d+23) then
tmp = (x * y) / (a + a)
else
tmp = fmin(z, t) * (t_1 / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = -4.5 * fmax(z, t);
double t_2 = (fmin(z, t) * 9.0) * fmax(z, t);
double tmp;
if (t_2 <= -2e+21) {
tmp = (fmin(z, t) / a) * t_1;
} else if (t_2 <= 1e+23) {
tmp = (x * y) / (a + a);
} else {
tmp = fmin(z, t) * (t_1 / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -4.5 * fmax(z, t) t_2 = (fmin(z, t) * 9.0) * fmax(z, t) tmp = 0 if t_2 <= -2e+21: tmp = (fmin(z, t) / a) * t_1 elif t_2 <= 1e+23: tmp = (x * y) / (a + a) else: tmp = fmin(z, t) * (t_1 / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(-4.5 * fmax(z, t)) t_2 = Float64(Float64(fmin(z, t) * 9.0) * fmax(z, t)) tmp = 0.0 if (t_2 <= -2e+21) tmp = Float64(Float64(fmin(z, t) / a) * t_1); elseif (t_2 <= 1e+23) tmp = Float64(Float64(x * y) / Float64(a + a)); else tmp = Float64(fmin(z, t) * Float64(t_1 / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -4.5 * max(z, t); t_2 = (min(z, t) * 9.0) * max(z, t); tmp = 0.0; if (t_2 <= -2e+21) tmp = (min(z, t) / a) * t_1; elseif (t_2 <= 1e+23) tmp = (x * y) / (a + a); else tmp = min(z, t) * (t_1 / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-4.5 * N[Max[z, t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Min[z, t], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[z, t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+21], N[(N[(N[Min[z, t], $MachinePrecision] / a), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 1e+23], N[(N[(x * y), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision], N[(N[Min[z, t], $MachinePrecision] * N[(t$95$1 / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := -4.5 \cdot \mathsf{max}\left(z, t\right)\\
t_2 := \left(\mathsf{min}\left(z, t\right) \cdot 9\right) \cdot \mathsf{max}\left(z, t\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+21}:\\
\;\;\;\;\frac{\mathsf{min}\left(z, t\right)}{a} \cdot t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+23}:\\
\;\;\;\;\frac{x \cdot y}{a + a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{min}\left(z, t\right) \cdot \frac{t\_1}{a}\\
\end{array}
if (*.f64 (*.f64 z #s(literal 9 binary64)) t) < -2e21Initial program 91.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6450.0%
Applied rewrites50.0%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
metadata-evalN/A
lower-*.f6450.8%
Applied rewrites50.8%
if -2e21 < (*.f64 (*.f64 z #s(literal 9 binary64)) t) < 9.9999999999999992e22Initial program 91.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6451.0%
Applied rewrites51.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
*-rgt-identityN/A
*-commutativeN/A
count-2N/A
lift-+.f64N/A
lower-/.f6450.9%
Applied rewrites50.9%
if 9.9999999999999992e22 < (*.f64 (*.f64 z #s(literal 9 binary64)) t) Initial program 91.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6450.0%
Applied rewrites50.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-2negN/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
metadata-evalN/A
associate-/l*N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-/l*N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
lower-*.f64N/A
lower-neg.f6451.1%
Applied rewrites51.1%
lift-/.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-*.f6451.1%
Applied rewrites51.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (* (fmin z t) 9.0) (fmax z t))))
(if (<= t_1 -2e+21)
(* (* (/ (fmin z t) a) -4.5) (fmax z t))
(if (<= t_1 1e+23)
(/ (* x y) (+ a a))
(* (fmin z t) (/ (* -4.5 (fmax z t)) a))))))double code(double x, double y, double z, double t, double a) {
double t_1 = (fmin(z, t) * 9.0) * fmax(z, t);
double tmp;
if (t_1 <= -2e+21) {
tmp = ((fmin(z, t) / a) * -4.5) * fmax(z, t);
} else if (t_1 <= 1e+23) {
tmp = (x * y) / (a + a);
} else {
tmp = fmin(z, t) * ((-4.5 * fmax(z, t)) / 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)
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) :: t_1
real(8) :: tmp
t_1 = (fmin(z, t) * 9.0d0) * fmax(z, t)
if (t_1 <= (-2d+21)) then
tmp = ((fmin(z, t) / a) * (-4.5d0)) * fmax(z, t)
else if (t_1 <= 1d+23) then
tmp = (x * y) / (a + a)
else
tmp = fmin(z, t) * (((-4.5d0) * fmax(z, t)) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (fmin(z, t) * 9.0) * fmax(z, t);
double tmp;
if (t_1 <= -2e+21) {
tmp = ((fmin(z, t) / a) * -4.5) * fmax(z, t);
} else if (t_1 <= 1e+23) {
tmp = (x * y) / (a + a);
} else {
tmp = fmin(z, t) * ((-4.5 * fmax(z, t)) / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (fmin(z, t) * 9.0) * fmax(z, t) tmp = 0 if t_1 <= -2e+21: tmp = ((fmin(z, t) / a) * -4.5) * fmax(z, t) elif t_1 <= 1e+23: tmp = (x * y) / (a + a) else: tmp = fmin(z, t) * ((-4.5 * fmax(z, t)) / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(fmin(z, t) * 9.0) * fmax(z, t)) tmp = 0.0 if (t_1 <= -2e+21) tmp = Float64(Float64(Float64(fmin(z, t) / a) * -4.5) * fmax(z, t)); elseif (t_1 <= 1e+23) tmp = Float64(Float64(x * y) / Float64(a + a)); else tmp = Float64(fmin(z, t) * Float64(Float64(-4.5 * fmax(z, t)) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (min(z, t) * 9.0) * max(z, t); tmp = 0.0; if (t_1 <= -2e+21) tmp = ((min(z, t) / a) * -4.5) * max(z, t); elseif (t_1 <= 1e+23) tmp = (x * y) / (a + a); else tmp = min(z, t) * ((-4.5 * max(z, t)) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Min[z, t], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[z, t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+21], N[(N[(N[(N[Min[z, t], $MachinePrecision] / a), $MachinePrecision] * -4.5), $MachinePrecision] * N[Max[z, t], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+23], N[(N[(x * y), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision], N[(N[Min[z, t], $MachinePrecision] * N[(N[(-4.5 * N[Max[z, t], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\mathsf{min}\left(z, t\right) \cdot 9\right) \cdot \mathsf{max}\left(z, t\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+21}:\\
\;\;\;\;\left(\frac{\mathsf{min}\left(z, t\right)}{a} \cdot -4.5\right) \cdot \mathsf{max}\left(z, t\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+23}:\\
\;\;\;\;\frac{x \cdot y}{a + a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{min}\left(z, t\right) \cdot \frac{-4.5 \cdot \mathsf{max}\left(z, t\right)}{a}\\
\end{array}
if (*.f64 (*.f64 z #s(literal 9 binary64)) t) < -2e21Initial program 91.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6450.0%
Applied rewrites50.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
times-fracN/A
*-commutativeN/A
*-commutativeN/A
frac-timesN/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6450.8%
Applied rewrites50.8%
if -2e21 < (*.f64 (*.f64 z #s(literal 9 binary64)) t) < 9.9999999999999992e22Initial program 91.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6451.0%
Applied rewrites51.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
*-rgt-identityN/A
*-commutativeN/A
count-2N/A
lift-+.f64N/A
lower-/.f6450.9%
Applied rewrites50.9%
if 9.9999999999999992e22 < (*.f64 (*.f64 z #s(literal 9 binary64)) t) Initial program 91.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6450.0%
Applied rewrites50.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-2negN/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
metadata-evalN/A
associate-/l*N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-/l*N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
lower-*.f64N/A
lower-neg.f6451.1%
Applied rewrites51.1%
lift-/.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-*.f6451.1%
Applied rewrites51.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (* (fmin z t) 9.0) (fmax z t))))
(if (<= t_1 -5e-19)
(* (* (fmin z t) (fmax z t)) (/ -4.5 a))
(if (<= t_1 1e+23)
(/ (* x y) (+ a a))
(* (fmin z t) (/ (* -4.5 (fmax z t)) a))))))double code(double x, double y, double z, double t, double a) {
double t_1 = (fmin(z, t) * 9.0) * fmax(z, t);
double tmp;
if (t_1 <= -5e-19) {
tmp = (fmin(z, t) * fmax(z, t)) * (-4.5 / a);
} else if (t_1 <= 1e+23) {
tmp = (x * y) / (a + a);
} else {
tmp = fmin(z, t) * ((-4.5 * fmax(z, t)) / 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)
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) :: t_1
real(8) :: tmp
t_1 = (fmin(z, t) * 9.0d0) * fmax(z, t)
if (t_1 <= (-5d-19)) then
tmp = (fmin(z, t) * fmax(z, t)) * ((-4.5d0) / a)
else if (t_1 <= 1d+23) then
tmp = (x * y) / (a + a)
else
tmp = fmin(z, t) * (((-4.5d0) * fmax(z, t)) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (fmin(z, t) * 9.0) * fmax(z, t);
double tmp;
if (t_1 <= -5e-19) {
tmp = (fmin(z, t) * fmax(z, t)) * (-4.5 / a);
} else if (t_1 <= 1e+23) {
tmp = (x * y) / (a + a);
} else {
tmp = fmin(z, t) * ((-4.5 * fmax(z, t)) / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (fmin(z, t) * 9.0) * fmax(z, t) tmp = 0 if t_1 <= -5e-19: tmp = (fmin(z, t) * fmax(z, t)) * (-4.5 / a) elif t_1 <= 1e+23: tmp = (x * y) / (a + a) else: tmp = fmin(z, t) * ((-4.5 * fmax(z, t)) / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(fmin(z, t) * 9.0) * fmax(z, t)) tmp = 0.0 if (t_1 <= -5e-19) tmp = Float64(Float64(fmin(z, t) * fmax(z, t)) * Float64(-4.5 / a)); elseif (t_1 <= 1e+23) tmp = Float64(Float64(x * y) / Float64(a + a)); else tmp = Float64(fmin(z, t) * Float64(Float64(-4.5 * fmax(z, t)) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (min(z, t) * 9.0) * max(z, t); tmp = 0.0; if (t_1 <= -5e-19) tmp = (min(z, t) * max(z, t)) * (-4.5 / a); elseif (t_1 <= 1e+23) tmp = (x * y) / (a + a); else tmp = min(z, t) * ((-4.5 * max(z, t)) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Min[z, t], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[z, t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-19], N[(N[(N[Min[z, t], $MachinePrecision] * N[Max[z, t], $MachinePrecision]), $MachinePrecision] * N[(-4.5 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+23], N[(N[(x * y), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision], N[(N[Min[z, t], $MachinePrecision] * N[(N[(-4.5 * N[Max[z, t], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\mathsf{min}\left(z, t\right) \cdot 9\right) \cdot \mathsf{max}\left(z, t\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-19}:\\
\;\;\;\;\left(\mathsf{min}\left(z, t\right) \cdot \mathsf{max}\left(z, t\right)\right) \cdot \frac{-4.5}{a}\\
\mathbf{elif}\;t\_1 \leq 10^{+23}:\\
\;\;\;\;\frac{x \cdot y}{a + a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{min}\left(z, t\right) \cdot \frac{-4.5 \cdot \mathsf{max}\left(z, t\right)}{a}\\
\end{array}
if (*.f64 (*.f64 z #s(literal 9 binary64)) t) < -5.0000000000000004e-19Initial program 91.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6450.0%
Applied rewrites50.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-*l/N/A
metadata-evalN/A
lower-/.f6450.0%
Applied rewrites50.0%
if -5.0000000000000004e-19 < (*.f64 (*.f64 z #s(literal 9 binary64)) t) < 9.9999999999999992e22Initial program 91.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6451.0%
Applied rewrites51.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
*-rgt-identityN/A
*-commutativeN/A
count-2N/A
lift-+.f64N/A
lower-/.f6450.9%
Applied rewrites50.9%
if 9.9999999999999992e22 < (*.f64 (*.f64 z #s(literal 9 binary64)) t) Initial program 91.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6450.0%
Applied rewrites50.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-2negN/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
metadata-evalN/A
associate-/l*N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-/l*N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
lower-*.f64N/A
lower-neg.f6451.1%
Applied rewrites51.1%
lift-/.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-*.f6451.1%
Applied rewrites51.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (* (fmin z t) 9.0) (fmax z t))))
(if (<= t_1 -5e-19)
(* -4.5 (/ (* (fmax z t) (fmin z t)) a))
(if (<= t_1 1e+23)
(/ (* x y) (+ a a))
(* (fmin z t) (/ (* -4.5 (fmax z t)) a))))))double code(double x, double y, double z, double t, double a) {
double t_1 = (fmin(z, t) * 9.0) * fmax(z, t);
double tmp;
if (t_1 <= -5e-19) {
tmp = -4.5 * ((fmax(z, t) * fmin(z, t)) / a);
} else if (t_1 <= 1e+23) {
tmp = (x * y) / (a + a);
} else {
tmp = fmin(z, t) * ((-4.5 * fmax(z, t)) / 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)
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) :: t_1
real(8) :: tmp
t_1 = (fmin(z, t) * 9.0d0) * fmax(z, t)
if (t_1 <= (-5d-19)) then
tmp = (-4.5d0) * ((fmax(z, t) * fmin(z, t)) / a)
else if (t_1 <= 1d+23) then
tmp = (x * y) / (a + a)
else
tmp = fmin(z, t) * (((-4.5d0) * fmax(z, t)) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (fmin(z, t) * 9.0) * fmax(z, t);
double tmp;
if (t_1 <= -5e-19) {
tmp = -4.5 * ((fmax(z, t) * fmin(z, t)) / a);
} else if (t_1 <= 1e+23) {
tmp = (x * y) / (a + a);
} else {
tmp = fmin(z, t) * ((-4.5 * fmax(z, t)) / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (fmin(z, t) * 9.0) * fmax(z, t) tmp = 0 if t_1 <= -5e-19: tmp = -4.5 * ((fmax(z, t) * fmin(z, t)) / a) elif t_1 <= 1e+23: tmp = (x * y) / (a + a) else: tmp = fmin(z, t) * ((-4.5 * fmax(z, t)) / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(fmin(z, t) * 9.0) * fmax(z, t)) tmp = 0.0 if (t_1 <= -5e-19) tmp = Float64(-4.5 * Float64(Float64(fmax(z, t) * fmin(z, t)) / a)); elseif (t_1 <= 1e+23) tmp = Float64(Float64(x * y) / Float64(a + a)); else tmp = Float64(fmin(z, t) * Float64(Float64(-4.5 * fmax(z, t)) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (min(z, t) * 9.0) * max(z, t); tmp = 0.0; if (t_1 <= -5e-19) tmp = -4.5 * ((max(z, t) * min(z, t)) / a); elseif (t_1 <= 1e+23) tmp = (x * y) / (a + a); else tmp = min(z, t) * ((-4.5 * max(z, t)) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Min[z, t], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[z, t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-19], N[(-4.5 * N[(N[(N[Max[z, t], $MachinePrecision] * N[Min[z, t], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+23], N[(N[(x * y), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision], N[(N[Min[z, t], $MachinePrecision] * N[(N[(-4.5 * N[Max[z, t], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\mathsf{min}\left(z, t\right) \cdot 9\right) \cdot \mathsf{max}\left(z, t\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-19}:\\
\;\;\;\;-4.5 \cdot \frac{\mathsf{max}\left(z, t\right) \cdot \mathsf{min}\left(z, t\right)}{a}\\
\mathbf{elif}\;t\_1 \leq 10^{+23}:\\
\;\;\;\;\frac{x \cdot y}{a + a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{min}\left(z, t\right) \cdot \frac{-4.5 \cdot \mathsf{max}\left(z, t\right)}{a}\\
\end{array}
if (*.f64 (*.f64 z #s(literal 9 binary64)) t) < -5.0000000000000004e-19Initial program 91.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6450.0%
Applied rewrites50.0%
if -5.0000000000000004e-19 < (*.f64 (*.f64 z #s(literal 9 binary64)) t) < 9.9999999999999992e22Initial program 91.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6451.0%
Applied rewrites51.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
*-rgt-identityN/A
*-commutativeN/A
count-2N/A
lift-+.f64N/A
lower-/.f6450.9%
Applied rewrites50.9%
if 9.9999999999999992e22 < (*.f64 (*.f64 z #s(literal 9 binary64)) t) Initial program 91.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6450.0%
Applied rewrites50.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-2negN/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
metadata-evalN/A
associate-/l*N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-/l*N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
lower-*.f64N/A
lower-neg.f6451.1%
Applied rewrites51.1%
lift-/.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-*.f6451.1%
Applied rewrites51.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (* (fmin z t) 9.0) (fmax z t))))
(if (<= t_1 -5e-19)
(* -4.5 (/ (* (fmax z t) (fmin z t)) a))
(if (<= t_1 1e+23)
(/ (* x y) (+ a a))
(* (fmin z t) (* (/ (fmax z t) a) -4.5))))))double code(double x, double y, double z, double t, double a) {
double t_1 = (fmin(z, t) * 9.0) * fmax(z, t);
double tmp;
if (t_1 <= -5e-19) {
tmp = -4.5 * ((fmax(z, t) * fmin(z, t)) / a);
} else if (t_1 <= 1e+23) {
tmp = (x * y) / (a + a);
} else {
tmp = fmin(z, t) * ((fmax(z, t) / a) * -4.5);
}
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)
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) :: t_1
real(8) :: tmp
t_1 = (fmin(z, t) * 9.0d0) * fmax(z, t)
if (t_1 <= (-5d-19)) then
tmp = (-4.5d0) * ((fmax(z, t) * fmin(z, t)) / a)
else if (t_1 <= 1d+23) then
tmp = (x * y) / (a + a)
else
tmp = fmin(z, t) * ((fmax(z, t) / a) * (-4.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (fmin(z, t) * 9.0) * fmax(z, t);
double tmp;
if (t_1 <= -5e-19) {
tmp = -4.5 * ((fmax(z, t) * fmin(z, t)) / a);
} else if (t_1 <= 1e+23) {
tmp = (x * y) / (a + a);
} else {
tmp = fmin(z, t) * ((fmax(z, t) / a) * -4.5);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (fmin(z, t) * 9.0) * fmax(z, t) tmp = 0 if t_1 <= -5e-19: tmp = -4.5 * ((fmax(z, t) * fmin(z, t)) / a) elif t_1 <= 1e+23: tmp = (x * y) / (a + a) else: tmp = fmin(z, t) * ((fmax(z, t) / a) * -4.5) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(fmin(z, t) * 9.0) * fmax(z, t)) tmp = 0.0 if (t_1 <= -5e-19) tmp = Float64(-4.5 * Float64(Float64(fmax(z, t) * fmin(z, t)) / a)); elseif (t_1 <= 1e+23) tmp = Float64(Float64(x * y) / Float64(a + a)); else tmp = Float64(fmin(z, t) * Float64(Float64(fmax(z, t) / a) * -4.5)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (min(z, t) * 9.0) * max(z, t); tmp = 0.0; if (t_1 <= -5e-19) tmp = -4.5 * ((max(z, t) * min(z, t)) / a); elseif (t_1 <= 1e+23) tmp = (x * y) / (a + a); else tmp = min(z, t) * ((max(z, t) / a) * -4.5); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Min[z, t], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[z, t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-19], N[(-4.5 * N[(N[(N[Max[z, t], $MachinePrecision] * N[Min[z, t], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+23], N[(N[(x * y), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision], N[(N[Min[z, t], $MachinePrecision] * N[(N[(N[Max[z, t], $MachinePrecision] / a), $MachinePrecision] * -4.5), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\mathsf{min}\left(z, t\right) \cdot 9\right) \cdot \mathsf{max}\left(z, t\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-19}:\\
\;\;\;\;-4.5 \cdot \frac{\mathsf{max}\left(z, t\right) \cdot \mathsf{min}\left(z, t\right)}{a}\\
\mathbf{elif}\;t\_1 \leq 10^{+23}:\\
\;\;\;\;\frac{x \cdot y}{a + a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{min}\left(z, t\right) \cdot \left(\frac{\mathsf{max}\left(z, t\right)}{a} \cdot -4.5\right)\\
\end{array}
if (*.f64 (*.f64 z #s(literal 9 binary64)) t) < -5.0000000000000004e-19Initial program 91.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6450.0%
Applied rewrites50.0%
if -5.0000000000000004e-19 < (*.f64 (*.f64 z #s(literal 9 binary64)) t) < 9.9999999999999992e22Initial program 91.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6451.0%
Applied rewrites51.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
*-rgt-identityN/A
*-commutativeN/A
count-2N/A
lift-+.f64N/A
lower-/.f6450.9%
Applied rewrites50.9%
if 9.9999999999999992e22 < (*.f64 (*.f64 z #s(literal 9 binary64)) t) Initial program 91.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6450.0%
Applied rewrites50.0%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
times-fracN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f6451.1%
Applied rewrites51.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (* z 9.0) t)) (t_2 (* -4.5 (/ (* t z) a)))) (if (<= t_1 -5e-19) t_2 (if (<= t_1 1e+23) (/ (* x y) (+ a a)) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * 9.0) * t;
double t_2 = -4.5 * ((t * z) / a);
double tmp;
if (t_1 <= -5e-19) {
tmp = t_2;
} else if (t_1 <= 1e+23) {
tmp = (x * y) / (a + a);
} else {
tmp = t_2;
}
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)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z * 9.0d0) * t
t_2 = (-4.5d0) * ((t * z) / a)
if (t_1 <= (-5d-19)) then
tmp = t_2
else if (t_1 <= 1d+23) then
tmp = (x * y) / (a + a)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * 9.0) * t;
double t_2 = -4.5 * ((t * z) / a);
double tmp;
if (t_1 <= -5e-19) {
tmp = t_2;
} else if (t_1 <= 1e+23) {
tmp = (x * y) / (a + a);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * 9.0) * t t_2 = -4.5 * ((t * z) / a) tmp = 0 if t_1 <= -5e-19: tmp = t_2 elif t_1 <= 1e+23: tmp = (x * y) / (a + a) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * 9.0) * t) t_2 = Float64(-4.5 * Float64(Float64(t * z) / a)) tmp = 0.0 if (t_1 <= -5e-19) tmp = t_2; elseif (t_1 <= 1e+23) tmp = Float64(Float64(x * y) / Float64(a + a)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * 9.0) * t; t_2 = -4.5 * ((t * z) / a); tmp = 0.0; if (t_1 <= -5e-19) tmp = t_2; elseif (t_1 <= 1e+23) tmp = (x * y) / (a + a); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(-4.5 * N[(N[(t * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-19], t$95$2, If[LessEqual[t$95$1, 1e+23], N[(N[(x * y), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \left(z \cdot 9\right) \cdot t\\
t_2 := -4.5 \cdot \frac{t \cdot z}{a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-19}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+23}:\\
\;\;\;\;\frac{x \cdot y}{a + a}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (*.f64 z #s(literal 9 binary64)) t) < -5.0000000000000004e-19 or 9.9999999999999992e22 < (*.f64 (*.f64 z #s(literal 9 binary64)) t) Initial program 91.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6450.0%
Applied rewrites50.0%
if -5.0000000000000004e-19 < (*.f64 (*.f64 z #s(literal 9 binary64)) t) < 9.9999999999999992e22Initial program 91.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6451.0%
Applied rewrites51.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
*-rgt-identityN/A
*-commutativeN/A
count-2N/A
lift-+.f64N/A
lower-/.f6450.9%
Applied rewrites50.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (fabs a) (fabs a))))
(*
(copysign 1.0 a)
(if (<= (fabs a) 4.1e+79)
(/ (* (fmin x y) (fmax x y)) t_1)
(* (fmax x y) (/ (fmin x y) t_1))))))double code(double x, double y, double z, double t, double a) {
double t_1 = fabs(a) + fabs(a);
double tmp;
if (fabs(a) <= 4.1e+79) {
tmp = (fmin(x, y) * fmax(x, y)) / t_1;
} else {
tmp = fmax(x, y) * (fmin(x, y) / t_1);
}
return copysign(1.0, a) * tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.abs(a) + Math.abs(a);
double tmp;
if (Math.abs(a) <= 4.1e+79) {
tmp = (fmin(x, y) * fmax(x, y)) / t_1;
} else {
tmp = fmax(x, y) * (fmin(x, y) / t_1);
}
return Math.copySign(1.0, a) * tmp;
}
def code(x, y, z, t, a): t_1 = math.fabs(a) + math.fabs(a) tmp = 0 if math.fabs(a) <= 4.1e+79: tmp = (fmin(x, y) * fmax(x, y)) / t_1 else: tmp = fmax(x, y) * (fmin(x, y) / t_1) return math.copysign(1.0, a) * tmp
function code(x, y, z, t, a) t_1 = Float64(abs(a) + abs(a)) tmp = 0.0 if (abs(a) <= 4.1e+79) tmp = Float64(Float64(fmin(x, y) * fmax(x, y)) / t_1); else tmp = Float64(fmax(x, y) * Float64(fmin(x, y) / t_1)); end return Float64(copysign(1.0, a) * tmp) end
function tmp_2 = code(x, y, z, t, a) t_1 = abs(a) + abs(a); tmp = 0.0; if (abs(a) <= 4.1e+79) tmp = (min(x, y) * max(x, y)) / t_1; else tmp = max(x, y) * (min(x, y) / t_1); end tmp_2 = (sign(a) * abs(1.0)) * tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Abs[a], $MachinePrecision] + N[Abs[a], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[a], $MachinePrecision], 4.1e+79], N[(N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[Max[x, y], $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_1 := \left|a\right| + \left|a\right|\\
\mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|a\right| \leq 4.1 \cdot 10^{+79}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x, y\right) \cdot \frac{\mathsf{min}\left(x, y\right)}{t\_1}\\
\end{array}
\end{array}
if a < 4.1e79Initial program 91.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6451.0%
Applied rewrites51.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
*-rgt-identityN/A
*-commutativeN/A
count-2N/A
lift-+.f64N/A
lower-/.f6450.9%
Applied rewrites50.9%
if 4.1e79 < a Initial program 91.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6451.0%
Applied rewrites51.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
*-rgt-identityN/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
count-2N/A
lift-+.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6451.0%
Applied rewrites51.0%
(FPCore (x y z t a) :precision binary64 (* (fmax x y) (/ (fmin x y) (+ a a))))
double code(double x, double y, double z, double t, double a) {
return fmax(x, y) * (fmin(x, y) / (a + 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)
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
code = fmax(x, y) * (fmin(x, y) / (a + a))
end function
public static double code(double x, double y, double z, double t, double a) {
return fmax(x, y) * (fmin(x, y) / (a + a));
}
def code(x, y, z, t, a): return fmax(x, y) * (fmin(x, y) / (a + a))
function code(x, y, z, t, a) return Float64(fmax(x, y) * Float64(fmin(x, y) / Float64(a + a))) end
function tmp = code(x, y, z, t, a) tmp = max(x, y) * (min(x, y) / (a + a)); end
code[x_, y_, z_, t_, a_] := N[(N[Max[x, y], $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\mathsf{max}\left(x, y\right) \cdot \frac{\mathsf{min}\left(x, y\right)}{a + a}
Initial program 91.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6451.0%
Applied rewrites51.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
*-rgt-identityN/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
count-2N/A
lift-+.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6451.0%
Applied rewrites51.0%
(FPCore (x y z t a) :precision binary64 (* x (/ y (+ a a))))
double code(double x, double y, double z, double t, double a) {
return x * (y / (a + 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)
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
code = x * (y / (a + a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x * (y / (a + a));
}
def code(x, y, z, t, a): return x * (y / (a + a))
function code(x, y, z, t, a) return Float64(x * Float64(y / Float64(a + a))) end
function tmp = code(x, y, z, t, a) tmp = x * (y / (a + a)); end
code[x_, y_, z_, t_, a_] := N[(x * N[(y / N[(a + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot \frac{y}{a + a}
Initial program 91.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6451.0%
Applied rewrites51.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
*-rgt-identityN/A
*-commutativeN/A
lift-*.f64N/A
count-2N/A
lift-+.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6451.3%
Applied rewrites51.3%
herbie shell --seed 2025188
(FPCore (x y z t a)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I"
:precision binary64
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))