
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
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, c)
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), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
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, c)
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), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1
(fma
(/ (* 9.0 (fmin x y)) c)
(/ (fmax x y) z)
(* t (fma -4.0 (/ a c) (/ b (* c (* t z))))))))
(if (<= z -2.85e+125)
t_1
(if (<= z 1.5e+68)
(/
(/ (fma -9.0 (* (fmax x y) (fmin x y)) (- (* a (* t (* 4.0 z))) b)) c)
(- z))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(((9.0 * fmin(x, y)) / c), (fmax(x, y) / z), (t * fma(-4.0, (a / c), (b / (c * (t * z))))));
double tmp;
if (z <= -2.85e+125) {
tmp = t_1;
} else if (z <= 1.5e+68) {
tmp = (fma(-9.0, (fmax(x, y) * fmin(x, y)), ((a * (t * (4.0 * z))) - b)) / c) / -z;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(Float64(Float64(9.0 * fmin(x, y)) / c), Float64(fmax(x, y) / z), Float64(t * fma(-4.0, Float64(a / c), Float64(b / Float64(c * Float64(t * z)))))) tmp = 0.0 if (z <= -2.85e+125) tmp = t_1; elseif (z <= 1.5e+68) tmp = Float64(Float64(fma(-9.0, Float64(fmax(x, y) * fmin(x, y)), Float64(Float64(a * Float64(t * Float64(4.0 * z))) - b)) / c) / Float64(-z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / z), $MachinePrecision] + N[(t * N[(-4.0 * N[(a / c), $MachinePrecision] + N[(b / N[(c * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.85e+125], t$95$1, If[LessEqual[z, 1.5e+68], N[(N[(N[(-9.0 * N[(N[Max[x, y], $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(t * N[(4.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] / (-z)), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{9 \cdot \mathsf{min}\left(x, y\right)}{c}, \frac{\mathsf{max}\left(x, y\right)}{z}, t \cdot \mathsf{fma}\left(-4, \frac{a}{c}, \frac{b}{c \cdot \left(t \cdot z\right)}\right)\right)\\
\mathbf{if}\;z \leq -2.85 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+68}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(-9, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right), a \cdot \left(t \cdot \left(4 \cdot z\right)\right) - b\right)}{c}}{-z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.8499999999999998e125 or 1.5000000000000001e68 < z Initial program 79.7%
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
div-addN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites71.9%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6471.8%
Applied rewrites71.8%
if -2.8499999999999998e125 < z < 1.5000000000000001e68Initial program 79.7%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -3.3e+129)
(fma -4.0 (/ (* (fmax t a) (fmin t a)) c) (/ b (* c z)))
(if (<= z 6.8e+76)
(/
(/
(fma
-9.0
(* (fmax x y) (fmin x y))
(- (* (fmax t a) (* (fmin t a) (* 4.0 z))) b))
c)
(- z))
(/
(/
(fma
(* 9.0 (fmin x y))
(fmax x y)
(fma (* (fmin t a) (fmax t a)) (* z -4.0) b))
z)
c))))double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -3.3e+129) {
tmp = fma(-4.0, ((fmax(t, a) * fmin(t, a)) / c), (b / (c * z)));
} else if (z <= 6.8e+76) {
tmp = (fma(-9.0, (fmax(x, y) * fmin(x, y)), ((fmax(t, a) * (fmin(t, a) * (4.0 * z))) - b)) / c) / -z;
} else {
tmp = (fma((9.0 * fmin(x, y)), fmax(x, y), fma((fmin(t, a) * fmax(t, a)), (z * -4.0), b)) / z) / c;
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -3.3e+129) tmp = fma(-4.0, Float64(Float64(fmax(t, a) * fmin(t, a)) / c), Float64(b / Float64(c * z))); elseif (z <= 6.8e+76) tmp = Float64(Float64(fma(-9.0, Float64(fmax(x, y) * fmin(x, y)), Float64(Float64(fmax(t, a) * Float64(fmin(t, a) * Float64(4.0 * z))) - b)) / c) / Float64(-z)); else tmp = Float64(Float64(fma(Float64(9.0 * fmin(x, y)), fmax(x, y), fma(Float64(fmin(t, a) * fmax(t, a)), Float64(z * -4.0), b)) / z) / c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -3.3e+129], N[(-4.0 * N[(N[(N[Max[t, a], $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e+76], N[(N[(N[(-9.0 * N[(N[Max[x, y], $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Max[t, a], $MachinePrecision] * N[(N[Min[t, a], $MachinePrecision] * N[(4.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] / (-z)), $MachinePrecision], N[(N[(N[(N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision] + N[(N[(N[Min[t, a], $MachinePrecision] * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * N[(z * -4.0), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+129}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{\mathsf{max}\left(t, a\right) \cdot \mathsf{min}\left(t, a\right)}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+76}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(-9, \mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right), \mathsf{max}\left(t, a\right) \cdot \left(\mathsf{min}\left(t, a\right) \cdot \left(4 \cdot z\right)\right) - b\right)}{c}}{-z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(9 \cdot \mathsf{min}\left(x, y\right), \mathsf{max}\left(x, y\right), \mathsf{fma}\left(\mathsf{min}\left(t, a\right) \cdot \mathsf{max}\left(t, a\right), z \cdot -4, b\right)\right)}{z}}{c}\\
\end{array}
if z < -3.2999999999999999e129Initial program 79.7%
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
div-addN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites71.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6462.3%
Applied rewrites62.3%
if -3.2999999999999999e129 < z < 6.7999999999999994e76Initial program 79.7%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
if 6.7999999999999994e76 < z Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Applied rewrites82.4%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -7.2e+123)
(fma -4.0 (/ (* a t) c) (/ b (* c z)))
(if (<= z 8.6e+61)
(/ (/ (fma (* a (* -4.0 z)) t (fma (* (fmax x y) (fmin x y)) 9.0 b)) c) z)
(/
(/ (fma (* 9.0 (fmin x y)) (fmax x y) (fma (* t a) (* z -4.0) b)) z)
c))))double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -7.2e+123) {
tmp = fma(-4.0, ((a * t) / c), (b / (c * z)));
} else if (z <= 8.6e+61) {
tmp = (fma((a * (-4.0 * z)), t, fma((fmax(x, y) * fmin(x, y)), 9.0, b)) / c) / z;
} else {
tmp = (fma((9.0 * fmin(x, y)), fmax(x, y), fma((t * a), (z * -4.0), b)) / z) / c;
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -7.2e+123) tmp = fma(-4.0, Float64(Float64(a * t) / c), Float64(b / Float64(c * z))); elseif (z <= 8.6e+61) tmp = Float64(Float64(fma(Float64(a * Float64(-4.0 * z)), t, fma(Float64(fmax(x, y) * fmin(x, y)), 9.0, b)) / c) / z); else tmp = Float64(Float64(fma(Float64(9.0 * fmin(x, y)), fmax(x, y), fma(Float64(t * a), Float64(z * -4.0), b)) / z) / c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -7.2e+123], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.6e+61], N[(N[(N[(N[(a * N[(-4.0 * z), $MachinePrecision]), $MachinePrecision] * t + N[(N[(N[Max[x, y], $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision] * 9.0 + b), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision] + N[(N[(t * a), $MachinePrecision] * N[(z * -4.0), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+123}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{+61}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, \mathsf{fma}\left(\mathsf{max}\left(x, y\right) \cdot \mathsf{min}\left(x, y\right), 9, b\right)\right)}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(9 \cdot \mathsf{min}\left(x, y\right), \mathsf{max}\left(x, y\right), \mathsf{fma}\left(t \cdot a, z \cdot -4, b\right)\right)}{z}}{c}\\
\end{array}
if z < -7.19999999999999996e123Initial program 79.7%
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
div-addN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites71.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6462.3%
Applied rewrites62.3%
if -7.19999999999999996e123 < z < 8.6000000000000003e61Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
if 8.6000000000000003e61 < z Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Applied rewrites82.4%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -3.5e+206)
(* -4.0 (/ (* (fmax t a) (fmin t a)) c))
(if (<= z -1e-50)
(/ (/ (fma (* 9.0 x) y (fma (* (fmin t a) (fmax t a)) (* z -4.0) b)) z) c)
(/
(fma (* (* -4.0 z) (fmax t a)) (fmin t a) (fma (* y x) 9.0 b))
(* z c)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -3.5e+206) {
tmp = -4.0 * ((fmax(t, a) * fmin(t, a)) / c);
} else if (z <= -1e-50) {
tmp = (fma((9.0 * x), y, fma((fmin(t, a) * fmax(t, a)), (z * -4.0), b)) / z) / c;
} else {
tmp = fma(((-4.0 * z) * fmax(t, a)), fmin(t, a), fma((y * x), 9.0, b)) / (z * c);
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -3.5e+206) tmp = Float64(-4.0 * Float64(Float64(fmax(t, a) * fmin(t, a)) / c)); elseif (z <= -1e-50) tmp = Float64(Float64(fma(Float64(9.0 * x), y, fma(Float64(fmin(t, a) * fmax(t, a)), Float64(z * -4.0), b)) / z) / c); else tmp = Float64(fma(Float64(Float64(-4.0 * z) * fmax(t, a)), fmin(t, a), fma(Float64(y * x), 9.0, b)) / Float64(z * c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -3.5e+206], N[(-4.0 * N[(N[(N[Max[t, a], $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1e-50], N[(N[(N[(N[(9.0 * x), $MachinePrecision] * y + N[(N[(N[Min[t, a], $MachinePrecision] * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * N[(z * -4.0), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(N[(-4.0 * z), $MachinePrecision] * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * N[Min[t, a], $MachinePrecision] + N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+206}:\\
\;\;\;\;-4 \cdot \frac{\mathsf{max}\left(t, a\right) \cdot \mathsf{min}\left(t, a\right)}{c}\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-50}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(9 \cdot x, y, \mathsf{fma}\left(\mathsf{min}\left(t, a\right) \cdot \mathsf{max}\left(t, a\right), z \cdot -4, b\right)\right)}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot \mathsf{max}\left(t, a\right), \mathsf{min}\left(t, a\right), \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z \cdot c}\\
\end{array}
if z < -3.50000000000000014e206Initial program 79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.6%
Applied rewrites37.6%
if -3.50000000000000014e206 < z < -1.00000000000000001e-50Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Applied rewrites82.4%
if -1.00000000000000001e-50 < z Initial program 79.7%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
Applied rewrites79.9%
(FPCore (x y z t a b c) :precision binary64 (if (<= z -9e+61) (fma -4.0 (/ (* (fmax t a) (fmin t a)) c) (/ b (* c z))) (/ (fma (* (* -4.0 z) (fmax t a)) (fmin t a) (fma (* y x) 9.0 b)) (* z c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -9e+61) {
tmp = fma(-4.0, ((fmax(t, a) * fmin(t, a)) / c), (b / (c * z)));
} else {
tmp = fma(((-4.0 * z) * fmax(t, a)), fmin(t, a), fma((y * x), 9.0, b)) / (z * c);
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -9e+61) tmp = fma(-4.0, Float64(Float64(fmax(t, a) * fmin(t, a)) / c), Float64(b / Float64(c * z))); else tmp = Float64(fma(Float64(Float64(-4.0 * z) * fmax(t, a)), fmin(t, a), fma(Float64(y * x), 9.0, b)) / Float64(z * c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -9e+61], N[(-4.0 * N[(N[(N[Max[t, a], $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(-4.0 * z), $MachinePrecision] * N[Max[t, a], $MachinePrecision]), $MachinePrecision] * N[Min[t, a], $MachinePrecision] + N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+61}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{\mathsf{max}\left(t, a\right) \cdot \mathsf{min}\left(t, a\right)}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot \mathsf{max}\left(t, a\right), \mathsf{min}\left(t, a\right), \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z \cdot c}\\
\end{array}
if z < -9e61Initial program 79.7%
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
div-addN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites71.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6462.3%
Applied rewrites62.3%
if -9e61 < z Initial program 79.7%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
Applied rewrites79.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (fmax t a) (fmin t a))))
(if (<=
(/
(+ (- (* (* x 9.0) y) (* (* (* z 4.0) (fmin t a)) (fmax t a))) b)
(* z c))
INFINITY)
(/ (fma (* y 9.0) x (fma -4.0 (* t_1 z) b)) (* z c))
(* -4.0 (/ t_1 c)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fmax(t, a) * fmin(t, a);
double tmp;
if ((((((x * 9.0) * y) - (((z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / (z * c)) <= ((double) INFINITY)) {
tmp = fma((y * 9.0), x, fma(-4.0, (t_1 * z), b)) / (z * c);
} else {
tmp = -4.0 * (t_1 / c);
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(fmax(t, a) * fmin(t, a)) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / Float64(z * c)) <= Inf) tmp = Float64(fma(Float64(y * 9.0), x, fma(-4.0, Float64(t_1 * z), b)) / Float64(z * c)); else tmp = Float64(-4.0 * Float64(t_1 / c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[Max[t, a], $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] * N[Max[t, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(y * 9.0), $MachinePrecision] * x + N[(-4.0 * N[(t$95$1 * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t$95$1 / c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \mathsf{max}\left(t, a\right) \cdot \mathsf{min}\left(t, a\right)\\
\mathbf{if}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot \mathsf{min}\left(t, a\right)\right) \cdot \mathsf{max}\left(t, a\right)\right) + b}{z \cdot c} \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot 9, x, \mathsf{fma}\left(-4, t\_1 \cdot z, b\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t\_1}{c}\\
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 79.7%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
add-flip-revN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites80.9%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.6%
Applied rewrites37.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (fmax t a) (fmin t a))))
(if (<=
(/
(+
(-
(* (* (fmin x y) 9.0) (fmax x y))
(* (* (* z 4.0) (fmin t a)) (fmax t a)))
b)
(* z c))
INFINITY)
(/ (fma (* 9.0 (fmin x y)) (fmax x y) (fma -4.0 (* t_1 z) b)) (* z c))
(* -4.0 (/ t_1 c)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fmax(t, a) * fmin(t, a);
double tmp;
if ((((((fmin(x, y) * 9.0) * fmax(x, y)) - (((z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / (z * c)) <= ((double) INFINITY)) {
tmp = fma((9.0 * fmin(x, y)), fmax(x, y), fma(-4.0, (t_1 * z), b)) / (z * c);
} else {
tmp = -4.0 * (t_1 / c);
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(fmax(t, a) * fmin(t, a)) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(fmin(x, y) * 9.0) * fmax(x, y)) - Float64(Float64(Float64(z * 4.0) * fmin(t, a)) * fmax(t, a))) + b) / Float64(z * c)) <= Inf) tmp = Float64(fma(Float64(9.0 * fmin(x, y)), fmax(x, y), fma(-4.0, Float64(t_1 * z), b)) / Float64(z * c)); else tmp = Float64(-4.0 * Float64(t_1 / c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[Max[t, a], $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[Min[x, y], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] * N[Max[t, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision] + N[(-4.0 * N[(t$95$1 * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t$95$1 / c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \mathsf{max}\left(t, a\right) \cdot \mathsf{min}\left(t, a\right)\\
\mathbf{if}\;\frac{\left(\left(\mathsf{min}\left(x, y\right) \cdot 9\right) \cdot \mathsf{max}\left(x, y\right) - \left(\left(z \cdot 4\right) \cdot \mathsf{min}\left(t, a\right)\right) \cdot \mathsf{max}\left(t, a\right)\right) + b}{z \cdot c} \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(9 \cdot \mathsf{min}\left(x, y\right), \mathsf{max}\left(x, y\right), \mathsf{fma}\left(-4, t\_1 \cdot z, b\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t\_1}{c}\\
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 79.7%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
add-flip-revN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites80.9%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.6%
Applied rewrites37.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -1e+137)
(/ (/ (fma (* 9.0 x) y b) z) c)
(if (<= t_1 2e-302)
(fma -4.0 (/ (* (fmax t a) (fmin t a)) c) (/ b (* c z)))
(if (<= t_1 1e+29)
(/ (/ (fma (* (fmax t a) (* -4.0 z)) (fmin t a) b) c) z)
(/ (+ b (* 9.0 (* x y))) (* z c)))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -1e+137) {
tmp = (fma((9.0 * x), y, b) / z) / c;
} else if (t_1 <= 2e-302) {
tmp = fma(-4.0, ((fmax(t, a) * fmin(t, a)) / c), (b / (c * z)));
} else if (t_1 <= 1e+29) {
tmp = (fma((fmax(t, a) * (-4.0 * z)), fmin(t, a), b) / c) / z;
} else {
tmp = (b + (9.0 * (x * y))) / (z * c);
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -1e+137) tmp = Float64(Float64(fma(Float64(9.0 * x), y, b) / z) / c); elseif (t_1 <= 2e-302) tmp = fma(-4.0, Float64(Float64(fmax(t, a) * fmin(t, a)) / c), Float64(b / Float64(c * z))); elseif (t_1 <= 1e+29) tmp = Float64(Float64(fma(Float64(fmax(t, a) * Float64(-4.0 * z)), fmin(t, a), b) / c) / z); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+137], N[(N[(N[(N[(9.0 * x), $MachinePrecision] * y + b), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, 2e-302], N[(-4.0 * N[(N[(N[Max[t, a], $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+29], N[(N[(N[(N[(N[Max[t, a], $MachinePrecision] * N[(-4.0 * z), $MachinePrecision]), $MachinePrecision] * N[Min[t, a], $MachinePrecision] + b), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+137}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{z}}{c}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-302}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{\mathsf{max}\left(t, a\right) \cdot \mathsf{min}\left(t, a\right)}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+29}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{max}\left(t, a\right) \cdot \left(-4 \cdot z\right), \mathsf{min}\left(t, a\right), b\right)}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e137Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Applied rewrites82.4%
Taylor expanded in z around 0
Applied rewrites59.6%
if -1e137 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.9999999999999999e-302Initial program 79.7%
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
div-addN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites71.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6462.3%
Applied rewrites62.3%
if 1.9999999999999999e-302 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999914e28Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in x around 0
Applied rewrites56.1%
if 9.99999999999999914e28 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6461.4%
Applied rewrites61.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -1e+137)
(/ (/ (fma (* 9.0 x) y b) z) c)
(if (<= t_1 1e-20)
(fma -4.0 (/ (* a t) c) (/ b (* c z)))
(/ (+ b (* 9.0 (* x y))) (* z c))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -1e+137) {
tmp = (fma((9.0 * x), y, b) / z) / c;
} else if (t_1 <= 1e-20) {
tmp = fma(-4.0, ((a * t) / c), (b / (c * z)));
} else {
tmp = (b + (9.0 * (x * y))) / (z * c);
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -1e+137) tmp = Float64(Float64(fma(Float64(9.0 * x), y, b) / z) / c); elseif (t_1 <= 1e-20) tmp = fma(-4.0, Float64(Float64(a * t) / c), Float64(b / Float64(c * z))); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+137], N[(N[(N[(N[(9.0 * x), $MachinePrecision] * y + b), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, 1e-20], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+137}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{z}}{c}\\
\mathbf{elif}\;t\_1 \leq 10^{-20}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e137Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Applied rewrites82.4%
Taylor expanded in z around 0
Applied rewrites59.6%
if -1e137 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999945e-21Initial program 79.7%
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
div-addN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites71.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6462.3%
Applied rewrites62.3%
if 9.99999999999999945e-21 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6461.4%
Applied rewrites61.4%
(FPCore (x y z t a b c) :precision binary64 (if (<= z -2.6e+55) (/ (* -4.0 (* a t)) c) (/ (+ b (* 9.0 (* x y))) (* z c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2.6e+55) {
tmp = (-4.0 * (a * t)) / c;
} else {
tmp = (b + (9.0 * (x * y))) / (z * c);
}
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, c)
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), intent (in) :: c
real(8) :: tmp
if (z <= (-2.6d+55)) then
tmp = ((-4.0d0) * (a * t)) / c
else
tmp = (b + (9.0d0 * (x * y))) / (z * c)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2.6e+55) {
tmp = (-4.0 * (a * t)) / c;
} else {
tmp = (b + (9.0 * (x * y))) / (z * c);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if z <= -2.6e+55: tmp = (-4.0 * (a * t)) / c else: tmp = (b + (9.0 * (x * y))) / (z * c) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -2.6e+55) tmp = Float64(Float64(-4.0 * Float64(a * t)) / c); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (z <= -2.6e+55) tmp = (-4.0 * (a * t)) / c; else tmp = (b + (9.0 * (x * y))) / (z * c); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -2.6e+55], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+55}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\end{array}
if z < -2.6e55Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Applied rewrites82.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6437.6%
Applied rewrites37.6%
if -2.6e55 < z Initial program 79.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6461.4%
Applied rewrites61.4%
(FPCore (x y z t a b c) :precision binary64 (if (<= z -2.6e+55) (/ (* -4.0 (* a t)) c) (/ (/ (fma (* 9.0 (fmin x y)) (fmax x y) b) z) c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2.6e+55) {
tmp = (-4.0 * (a * t)) / c;
} else {
tmp = (fma((9.0 * fmin(x, y)), fmax(x, y), b) / z) / c;
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -2.6e+55) tmp = Float64(Float64(-4.0 * Float64(a * t)) / c); else tmp = Float64(Float64(fma(Float64(9.0 * fmin(x, y)), fmax(x, y), b) / z) / c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -2.6e+55], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+55}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(9 \cdot \mathsf{min}\left(x, y\right), \mathsf{max}\left(x, y\right), b\right)}{z}}{c}\\
\end{array}
if z < -2.6e55Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Applied rewrites82.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6437.6%
Applied rewrites37.6%
if -2.6e55 < z Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Applied rewrites82.4%
Taylor expanded in z around 0
Applied rewrites59.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -1e+137)
(/ (* 9.0 (/ (* x y) z)) c)
(if (<= t_1 -1e-231)
(/ (/ b c) z)
(if (<= t_1 1e-20)
(/ (* -4.0 (* a t)) c)
(* 9.0 (/ (* x y) (* c z))))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -1e+137) {
tmp = (9.0 * ((x * y) / z)) / c;
} else if (t_1 <= -1e-231) {
tmp = (b / c) / z;
} else if (t_1 <= 1e-20) {
tmp = (-4.0 * (a * t)) / c;
} else {
tmp = 9.0 * ((x * y) / (c * z));
}
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, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * 9.0d0) * y
if (t_1 <= (-1d+137)) then
tmp = (9.0d0 * ((x * y) / z)) / c
else if (t_1 <= (-1d-231)) then
tmp = (b / c) / z
else if (t_1 <= 1d-20) then
tmp = ((-4.0d0) * (a * t)) / c
else
tmp = 9.0d0 * ((x * y) / (c * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -1e+137) {
tmp = (9.0 * ((x * y) / z)) / c;
} else if (t_1 <= -1e-231) {
tmp = (b / c) / z;
} else if (t_1 <= 1e-20) {
tmp = (-4.0 * (a * t)) / c;
} else {
tmp = 9.0 * ((x * y) / (c * z));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y tmp = 0 if t_1 <= -1e+137: tmp = (9.0 * ((x * y) / z)) / c elif t_1 <= -1e-231: tmp = (b / c) / z elif t_1 <= 1e-20: tmp = (-4.0 * (a * t)) / c else: tmp = 9.0 * ((x * y) / (c * z)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -1e+137) tmp = Float64(Float64(9.0 * Float64(Float64(x * y) / z)) / c); elseif (t_1 <= -1e-231) tmp = Float64(Float64(b / c) / z); elseif (t_1 <= 1e-20) tmp = Float64(Float64(-4.0 * Float64(a * t)) / c); else tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(c * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; tmp = 0.0; if (t_1 <= -1e+137) tmp = (9.0 * ((x * y) / z)) / c; elseif (t_1 <= -1e-231) tmp = (b / c) / z; elseif (t_1 <= 1e-20) tmp = (-4.0 * (a * t)) / c; else tmp = 9.0 * ((x * y) / (c * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+137], N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, -1e-231], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 1e-20], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+137}:\\
\;\;\;\;\frac{9 \cdot \frac{x \cdot y}{z}}{c}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-231}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;t\_1 \leq 10^{-20}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{c \cdot z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e137Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Applied rewrites82.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6434.8%
Applied rewrites34.8%
if -1e137 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -9.9999999999999999e-232Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in b around inf
lower-/.f6435.4%
Applied rewrites35.4%
if -9.9999999999999999e-232 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999945e-21Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Applied rewrites82.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6437.6%
Applied rewrites37.6%
if 9.99999999999999945e-21 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (* 9.0 (/ (* x y) (* c z)))))
(if (<= t_1 -1e+137)
t_2
(if (<= t_1 -1e-231)
(/ (/ b c) z)
(if (<= t_1 1e-20) (/ (* -4.0 (* a t)) c) t_2)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = 9.0 * ((x * y) / (c * z));
double tmp;
if (t_1 <= -1e+137) {
tmp = t_2;
} else if (t_1 <= -1e-231) {
tmp = (b / c) / z;
} else if (t_1 <= 1e-20) {
tmp = (-4.0 * (a * t)) / c;
} 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, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * 9.0d0) * y
t_2 = 9.0d0 * ((x * y) / (c * z))
if (t_1 <= (-1d+137)) then
tmp = t_2
else if (t_1 <= (-1d-231)) then
tmp = (b / c) / z
else if (t_1 <= 1d-20) then
tmp = ((-4.0d0) * (a * t)) / c
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 b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = 9.0 * ((x * y) / (c * z));
double tmp;
if (t_1 <= -1e+137) {
tmp = t_2;
} else if (t_1 <= -1e-231) {
tmp = (b / c) / z;
} else if (t_1 <= 1e-20) {
tmp = (-4.0 * (a * t)) / c;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y t_2 = 9.0 * ((x * y) / (c * z)) tmp = 0 if t_1 <= -1e+137: tmp = t_2 elif t_1 <= -1e-231: tmp = (b / c) / z elif t_1 <= 1e-20: tmp = (-4.0 * (a * t)) / c else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(9.0 * Float64(Float64(x * y) / Float64(c * z))) tmp = 0.0 if (t_1 <= -1e+137) tmp = t_2; elseif (t_1 <= -1e-231) tmp = Float64(Float64(b / c) / z); elseif (t_1 <= 1e-20) tmp = Float64(Float64(-4.0 * Float64(a * t)) / c); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * 9.0) * y; t_2 = 9.0 * ((x * y) / (c * z)); tmp = 0.0; if (t_1 <= -1e+137) tmp = t_2; elseif (t_1 <= -1e-231) tmp = (b / c) / z; elseif (t_1 <= 1e-20) tmp = (-4.0 * (a * t)) / c; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+137], t$95$2, If[LessEqual[t$95$1, -1e-231], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 1e-20], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := 9 \cdot \frac{x \cdot y}{c \cdot z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+137}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-231}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;t\_1 \leq 10^{-20}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e137 or 9.99999999999999945e-21 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
if -1e137 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -9.9999999999999999e-232Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in b around inf
lower-/.f6435.4%
Applied rewrites35.4%
if -9.9999999999999999e-232 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999945e-21Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Applied rewrites82.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6437.6%
Applied rewrites37.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (fmax t a) (fmin t a))))
(if (<= (fmax t a) -1.6e-71)
(* -4.0 (/ t_1 c))
(if (<= (fmax t a) 14000000.0)
(* (/ (/ -1.0 z) c) (- b))
(/ (* -4.0 t_1) c)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fmax(t, a) * fmin(t, a);
double tmp;
if (fmax(t, a) <= -1.6e-71) {
tmp = -4.0 * (t_1 / c);
} else if (fmax(t, a) <= 14000000.0) {
tmp = ((-1.0 / z) / c) * -b;
} else {
tmp = (-4.0 * t_1) / c;
}
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, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = fmax(t, a) * fmin(t, a)
if (fmax(t, a) <= (-1.6d-71)) then
tmp = (-4.0d0) * (t_1 / c)
else if (fmax(t, a) <= 14000000.0d0) then
tmp = (((-1.0d0) / z) / c) * -b
else
tmp = ((-4.0d0) * t_1) / c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fmax(t, a) * fmin(t, a);
double tmp;
if (fmax(t, a) <= -1.6e-71) {
tmp = -4.0 * (t_1 / c);
} else if (fmax(t, a) <= 14000000.0) {
tmp = ((-1.0 / z) / c) * -b;
} else {
tmp = (-4.0 * t_1) / c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = fmax(t, a) * fmin(t, a) tmp = 0 if fmax(t, a) <= -1.6e-71: tmp = -4.0 * (t_1 / c) elif fmax(t, a) <= 14000000.0: tmp = ((-1.0 / z) / c) * -b else: tmp = (-4.0 * t_1) / c return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(fmax(t, a) * fmin(t, a)) tmp = 0.0 if (fmax(t, a) <= -1.6e-71) tmp = Float64(-4.0 * Float64(t_1 / c)); elseif (fmax(t, a) <= 14000000.0) tmp = Float64(Float64(Float64(-1.0 / z) / c) * Float64(-b)); else tmp = Float64(Float64(-4.0 * t_1) / c); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = max(t, a) * min(t, a); tmp = 0.0; if (max(t, a) <= -1.6e-71) tmp = -4.0 * (t_1 / c); elseif (max(t, a) <= 14000000.0) tmp = ((-1.0 / z) / c) * -b; else tmp = (-4.0 * t_1) / c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[Max[t, a], $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[t, a], $MachinePrecision], -1.6e-71], N[(-4.0 * N[(t$95$1 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Max[t, a], $MachinePrecision], 14000000.0], N[(N[(N[(-1.0 / z), $MachinePrecision] / c), $MachinePrecision] * (-b)), $MachinePrecision], N[(N[(-4.0 * t$95$1), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \mathsf{max}\left(t, a\right) \cdot \mathsf{min}\left(t, a\right)\\
\mathbf{if}\;\mathsf{max}\left(t, a\right) \leq -1.6 \cdot 10^{-71}:\\
\;\;\;\;-4 \cdot \frac{t\_1}{c}\\
\mathbf{elif}\;\mathsf{max}\left(t, a\right) \leq 14000000:\\
\;\;\;\;\frac{\frac{-1}{z}}{c} \cdot \left(-b\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-4 \cdot t\_1}{c}\\
\end{array}
if a < -1.5999999999999999e-71Initial program 79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.6%
Applied rewrites37.6%
if -1.5999999999999999e-71 < a < 1.4e7Initial program 79.7%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.8%
Applied rewrites35.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6434.1%
Applied rewrites34.1%
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
associate-/r/N/A
mult-flipN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f6435.3%
Applied rewrites35.3%
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-/r/N/A
lower-*.f64N/A
lift-/.f64N/A
frac-2negN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lift-/.f64N/A
frac-2neg-revN/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-neg.f6436.1%
Applied rewrites36.1%
if 1.4e7 < a Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Applied rewrites82.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6437.6%
Applied rewrites37.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (fmax t a) (fmin t a))))
(if (<= (fmax t a) -1.6e-71)
(* -4.0 (/ t_1 c))
(if (<= (fmax t a) 14000000.0)
(* (/ 1.0 (* c z)) b)
(/ (* -4.0 t_1) c)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fmax(t, a) * fmin(t, a);
double tmp;
if (fmax(t, a) <= -1.6e-71) {
tmp = -4.0 * (t_1 / c);
} else if (fmax(t, a) <= 14000000.0) {
tmp = (1.0 / (c * z)) * b;
} else {
tmp = (-4.0 * t_1) / c;
}
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, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = fmax(t, a) * fmin(t, a)
if (fmax(t, a) <= (-1.6d-71)) then
tmp = (-4.0d0) * (t_1 / c)
else if (fmax(t, a) <= 14000000.0d0) then
tmp = (1.0d0 / (c * z)) * b
else
tmp = ((-4.0d0) * t_1) / c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fmax(t, a) * fmin(t, a);
double tmp;
if (fmax(t, a) <= -1.6e-71) {
tmp = -4.0 * (t_1 / c);
} else if (fmax(t, a) <= 14000000.0) {
tmp = (1.0 / (c * z)) * b;
} else {
tmp = (-4.0 * t_1) / c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = fmax(t, a) * fmin(t, a) tmp = 0 if fmax(t, a) <= -1.6e-71: tmp = -4.0 * (t_1 / c) elif fmax(t, a) <= 14000000.0: tmp = (1.0 / (c * z)) * b else: tmp = (-4.0 * t_1) / c return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(fmax(t, a) * fmin(t, a)) tmp = 0.0 if (fmax(t, a) <= -1.6e-71) tmp = Float64(-4.0 * Float64(t_1 / c)); elseif (fmax(t, a) <= 14000000.0) tmp = Float64(Float64(1.0 / Float64(c * z)) * b); else tmp = Float64(Float64(-4.0 * t_1) / c); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = max(t, a) * min(t, a); tmp = 0.0; if (max(t, a) <= -1.6e-71) tmp = -4.0 * (t_1 / c); elseif (max(t, a) <= 14000000.0) tmp = (1.0 / (c * z)) * b; else tmp = (-4.0 * t_1) / c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[Max[t, a], $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[t, a], $MachinePrecision], -1.6e-71], N[(-4.0 * N[(t$95$1 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Max[t, a], $MachinePrecision], 14000000.0], N[(N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], N[(N[(-4.0 * t$95$1), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \mathsf{max}\left(t, a\right) \cdot \mathsf{min}\left(t, a\right)\\
\mathbf{if}\;\mathsf{max}\left(t, a\right) \leq -1.6 \cdot 10^{-71}:\\
\;\;\;\;-4 \cdot \frac{t\_1}{c}\\
\mathbf{elif}\;\mathsf{max}\left(t, a\right) \leq 14000000:\\
\;\;\;\;\frac{1}{c \cdot z} \cdot b\\
\mathbf{else}:\\
\;\;\;\;\frac{-4 \cdot t\_1}{c}\\
\end{array}
if a < -1.5999999999999999e-71Initial program 79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.6%
Applied rewrites37.6%
if -1.5999999999999999e-71 < a < 1.4e7Initial program 79.7%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.8%
Applied rewrites35.8%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.9%
Applied rewrites35.9%
if 1.4e7 < a Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Applied rewrites82.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6437.6%
Applied rewrites37.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (/ (* (fmax t a) (fmin t a)) c))))
(if (<= (fmax t a) -1.6e-71)
t_1
(if (<= (fmax t a) 14000000.0) (* (/ 1.0 (* c z)) b) t_1))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * ((fmax(t, a) * fmin(t, a)) / c);
double tmp;
if (fmax(t, a) <= -1.6e-71) {
tmp = t_1;
} else if (fmax(t, a) <= 14000000.0) {
tmp = (1.0 / (c * 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, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * ((fmax(t, a) * fmin(t, a)) / c)
if (fmax(t, a) <= (-1.6d-71)) then
tmp = t_1
else if (fmax(t, a) <= 14000000.0d0) then
tmp = (1.0d0 / (c * 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 c) {
double t_1 = -4.0 * ((fmax(t, a) * fmin(t, a)) / c);
double tmp;
if (fmax(t, a) <= -1.6e-71) {
tmp = t_1;
} else if (fmax(t, a) <= 14000000.0) {
tmp = (1.0 / (c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = -4.0 * ((fmax(t, a) * fmin(t, a)) / c) tmp = 0 if fmax(t, a) <= -1.6e-71: tmp = t_1 elif fmax(t, a) <= 14000000.0: tmp = (1.0 / (c * z)) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(Float64(fmax(t, a) * fmin(t, a)) / c)) tmp = 0.0 if (fmax(t, a) <= -1.6e-71) tmp = t_1; elseif (fmax(t, a) <= 14000000.0) tmp = Float64(Float64(1.0 / Float64(c * z)) * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = -4.0 * ((max(t, a) * min(t, a)) / c); tmp = 0.0; if (max(t, a) <= -1.6e-71) tmp = t_1; elseif (max(t, a) <= 14000000.0) tmp = (1.0 / (c * z)) * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(N[(N[Max[t, a], $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[t, a], $MachinePrecision], -1.6e-71], t$95$1, If[LessEqual[N[Max[t, a], $MachinePrecision], 14000000.0], N[(N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := -4 \cdot \frac{\mathsf{max}\left(t, a\right) \cdot \mathsf{min}\left(t, a\right)}{c}\\
\mathbf{if}\;\mathsf{max}\left(t, a\right) \leq -1.6 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\mathsf{max}\left(t, a\right) \leq 14000000:\\
\;\;\;\;\frac{1}{c \cdot z} \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -1.5999999999999999e-71 or 1.4e7 < a Initial program 79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.6%
Applied rewrites37.6%
if -1.5999999999999999e-71 < a < 1.4e7Initial program 79.7%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.8%
Applied rewrites35.8%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.9%
Applied rewrites35.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (/ (* (fmax t a) (fmin t a)) c))))
(if (<= (fmax t a) -1.6e-71)
t_1
(if (<= (fmax t a) 14000000.0) (/ (/ b c) z) t_1))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * ((fmax(t, a) * fmin(t, a)) / c);
double tmp;
if (fmax(t, a) <= -1.6e-71) {
tmp = t_1;
} else if (fmax(t, a) <= 14000000.0) {
tmp = (b / c) / z;
} 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, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * ((fmax(t, a) * fmin(t, a)) / c)
if (fmax(t, a) <= (-1.6d-71)) then
tmp = t_1
else if (fmax(t, a) <= 14000000.0d0) then
tmp = (b / c) / z
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 c) {
double t_1 = -4.0 * ((fmax(t, a) * fmin(t, a)) / c);
double tmp;
if (fmax(t, a) <= -1.6e-71) {
tmp = t_1;
} else if (fmax(t, a) <= 14000000.0) {
tmp = (b / c) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = -4.0 * ((fmax(t, a) * fmin(t, a)) / c) tmp = 0 if fmax(t, a) <= -1.6e-71: tmp = t_1 elif fmax(t, a) <= 14000000.0: tmp = (b / c) / z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(Float64(fmax(t, a) * fmin(t, a)) / c)) tmp = 0.0 if (fmax(t, a) <= -1.6e-71) tmp = t_1; elseif (fmax(t, a) <= 14000000.0) tmp = Float64(Float64(b / c) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = -4.0 * ((max(t, a) * min(t, a)) / c); tmp = 0.0; if (max(t, a) <= -1.6e-71) tmp = t_1; elseif (max(t, a) <= 14000000.0) tmp = (b / c) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(N[(N[Max[t, a], $MachinePrecision] * N[Min[t, a], $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[t, a], $MachinePrecision], -1.6e-71], t$95$1, If[LessEqual[N[Max[t, a], $MachinePrecision], 14000000.0], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := -4 \cdot \frac{\mathsf{max}\left(t, a\right) \cdot \mathsf{min}\left(t, a\right)}{c}\\
\mathbf{if}\;\mathsf{max}\left(t, a\right) \leq -1.6 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\mathsf{max}\left(t, a\right) \leq 14000000:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -1.5999999999999999e-71 or 1.4e7 < a Initial program 79.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.6%
Applied rewrites37.6%
if -1.5999999999999999e-71 < a < 1.4e7Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in b around inf
lower-/.f6435.4%
Applied rewrites35.4%
(FPCore (x y z t a b c) :precision binary64 (if (<= (fmax x y) 1.2e+128) (/ (/ b c) z) (/ b (* c z))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (fmax(x, y) <= 1.2e+128) {
tmp = (b / c) / z;
} else {
tmp = b / (c * z);
}
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, c)
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), intent (in) :: c
real(8) :: tmp
if (fmax(x, y) <= 1.2d+128) then
tmp = (b / c) / z
else
tmp = b / (c * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (fmax(x, y) <= 1.2e+128) {
tmp = (b / c) / z;
} else {
tmp = b / (c * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if fmax(x, y) <= 1.2e+128: tmp = (b / c) / z else: tmp = b / (c * z) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (fmax(x, y) <= 1.2e+128) tmp = Float64(Float64(b / c) / z); else tmp = Float64(b / Float64(c * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (max(x, y) <= 1.2e+128) tmp = (b / c) / z; else tmp = b / (c * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[Max[x, y], $MachinePrecision], 1.2e+128], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 1.2 \cdot 10^{+128}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\end{array}
if y < 1.2000000000000001e128Initial program 79.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.2%
Taylor expanded in b around inf
lower-/.f6435.4%
Applied rewrites35.4%
if 1.2000000000000001e128 < y Initial program 79.7%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.8%
Applied rewrites35.8%
(FPCore (x y z t a b c) :precision binary64 (/ b (* c z)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = b / (c * z)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
def code(x, y, z, t, a, b, c): return b / (c * z)
function code(x, y, z, t, a, b, c) return Float64(b / Float64(c * z)) end
function tmp = code(x, y, z, t, a, b, c) tmp = b / (c * z); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]
\frac{b}{c \cdot z}
Initial program 79.7%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.8%
Applied rewrites35.8%
herbie shell --seed 2025188
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))