
(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 17 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
(*
(copysign 1.0 c)
(if (<= (fabs c) 0.4)
(/
(/ 1.0 (fabs c))
(/ z (fma (* x y) 9.0 (fma (* (* a t) z) -4.0 b))))
(fma
(/ (* t -4.0) (fabs c))
a
(/ (fma (* y x) 9.0 b) (* (fabs c) z))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (fabs(c) <= 0.4) {
tmp = (1.0 / fabs(c)) / (z / fma((x * y), 9.0, fma(((a * t) * z), -4.0, b)));
} else {
tmp = fma(((t * -4.0) / fabs(c)), a, (fma((y * x), 9.0, b) / (fabs(c) * z)));
}
return copysign(1.0, c) * tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (abs(c) <= 0.4) tmp = Float64(Float64(1.0 / abs(c)) / Float64(z / fma(Float64(x * y), 9.0, fma(Float64(Float64(a * t) * z), -4.0, b)))); else tmp = fma(Float64(Float64(t * -4.0) / abs(c)), a, Float64(fma(Float64(y * x), 9.0, b) / Float64(abs(c) * z))); end return Float64(copysign(1.0, c) * tmp) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[c], $MachinePrecision], 0.4], N[(N[(1.0 / N[Abs[c], $MachinePrecision]), $MachinePrecision] / N[(z / N[(N[(x * y), $MachinePrecision] * 9.0 + N[(N[(N[(a * t), $MachinePrecision] * z), $MachinePrecision] * -4.0 + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t * -4.0), $MachinePrecision] / N[Abs[c], $MachinePrecision]), $MachinePrecision] * a + N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / N[(N[Abs[c], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|c\right| \leq 0.4:\\
\;\;\;\;\frac{\frac{1}{\left|c\right|}}{\frac{z}{\mathsf{fma}\left(x \cdot y, 9, \mathsf{fma}\left(\left(a \cdot t\right) \cdot z, -4, b\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t \cdot -4}{\left|c\right|}, a, \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{\left|c\right| \cdot z}\right)\\
\end{array}
if c < 0.40000000000000002Initial program 80.2%
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 rewrites81.4%
Applied rewrites78.7%
Applied rewrites83.1%
if 0.40000000000000002 < c Initial program 80.2%
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 rewrites81.4%
Applied rewrites78.7%
Taylor expanded in z around 0
Applied rewrites85.2%
(FPCore (x y z t a b c)
:precision binary64
(*
(copysign 1.0 c)
(if (<= (fabs c) 7.9e-28)
(/ (fma (* 9.0 x) y (fma -4.0 (* (* a t) z) b)) (* z (fabs c)))
(fma
(/ (* t -4.0) (fabs c))
a
(/ (fma (* y x) 9.0 b) (* (fabs c) z))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (fabs(c) <= 7.9e-28) {
tmp = fma((9.0 * x), y, fma(-4.0, ((a * t) * z), b)) / (z * fabs(c));
} else {
tmp = fma(((t * -4.0) / fabs(c)), a, (fma((y * x), 9.0, b) / (fabs(c) * z)));
}
return copysign(1.0, c) * tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (abs(c) <= 7.9e-28) tmp = Float64(fma(Float64(9.0 * x), y, fma(-4.0, Float64(Float64(a * t) * z), b)) / Float64(z * abs(c))); else tmp = fma(Float64(Float64(t * -4.0) / abs(c)), a, Float64(fma(Float64(y * x), 9.0, b) / Float64(abs(c) * z))); end return Float64(copysign(1.0, c) * tmp) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[c], $MachinePrecision], 7.9e-28], N[(N[(N[(9.0 * x), $MachinePrecision] * y + N[(-4.0 * N[(N[(a * t), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * N[Abs[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t * -4.0), $MachinePrecision] / N[Abs[c], $MachinePrecision]), $MachinePrecision] * a + N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / N[(N[Abs[c], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|c\right| \leq 7.9 \cdot 10^{-28}:\\
\;\;\;\;\frac{\mathsf{fma}\left(9 \cdot x, y, \mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)\right)}{z \cdot \left|c\right|}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t \cdot -4}{\left|c\right|}, a, \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{\left|c\right| \cdot z}\right)\\
\end{array}
if c < 7.8999999999999999e-28Initial program 80.2%
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 rewrites81.4%
if 7.8999999999999999e-28 < c Initial program 80.2%
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 rewrites81.4%
Applied rewrites78.7%
Taylor expanded in z around 0
Applied rewrites85.2%
(FPCore (x y z t a b c)
:precision binary64
(*
(copysign 1.0 c)
(if (<= (fabs c) 2.4e+144)
(/
(fma (* 9.0 (fmin x y)) (fmax x y) (fma -4.0 (* (* a t) z) b))
(* z (fabs c)))
(/
(/
(fma (* a (* -4.0 z)) t (fma (* (fmax x y) (fmin x y)) 9.0 b))
(fabs c))
z))))double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (fabs(c) <= 2.4e+144) {
tmp = fma((9.0 * fmin(x, y)), fmax(x, y), fma(-4.0, ((a * t) * z), b)) / (z * fabs(c));
} else {
tmp = (fma((a * (-4.0 * z)), t, fma((fmax(x, y) * fmin(x, y)), 9.0, b)) / fabs(c)) / z;
}
return copysign(1.0, c) * tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (abs(c) <= 2.4e+144) tmp = Float64(fma(Float64(9.0 * fmin(x, y)), fmax(x, y), fma(-4.0, Float64(Float64(a * t) * z), b)) / Float64(z * abs(c))); else tmp = Float64(Float64(fma(Float64(a * Float64(-4.0 * z)), t, fma(Float64(fmax(x, y) * fmin(x, y)), 9.0, b)) / abs(c)) / z); end return Float64(copysign(1.0, c) * tmp) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[c], $MachinePrecision], 2.4e+144], N[(N[(N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision] + N[(-4.0 * N[(N[(a * t), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * N[Abs[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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] / N[Abs[c], $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|c\right| \leq 2.4 \cdot 10^{+144}:\\
\;\;\;\;\frac{\mathsf{fma}\left(9 \cdot \mathsf{min}\left(x, y\right), \mathsf{max}\left(x, y\right), \mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)\right)}{z \cdot \left|c\right|}\\
\mathbf{else}:\\
\;\;\;\;\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)}{\left|c\right|}}{z}\\
\end{array}
if c < 2.4000000000000001e144Initial program 80.2%
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 rewrites81.4%
if 2.4000000000000001e144 < c Initial program 80.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma -4.0 (/ (* (fmax t a) (fmin t a)) c) (/ b (* c z)))))
(if (<= z -2.2e+202)
t_1
(if (<= z 2.2e+160)
(/
(fma (* -4.0 (* (fmin t a) z)) (fmax t a) (fma (* y x) 9.0 b))
(* z c))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(-4.0, ((fmax(t, a) * fmin(t, a)) / c), (b / (c * z)));
double tmp;
if (z <= -2.2e+202) {
tmp = t_1;
} else if (z <= 2.2e+160) {
tmp = fma((-4.0 * (fmin(t, a) * z)), fmax(t, a), fma((y * x), 9.0, b)) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(-4.0, Float64(Float64(fmax(t, a) * fmin(t, a)) / c), Float64(b / Float64(c * z))) tmp = 0.0 if (z <= -2.2e+202) tmp = t_1; elseif (z <= 2.2e+160) tmp = Float64(fma(Float64(-4.0 * Float64(fmin(t, a) * z)), fmax(t, a), fma(Float64(y * x), 9.0, b)) / Float64(z * c)); else tmp = t_1; end return 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] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+202], t$95$1, If[LessEqual[z, 2.2e+160], N[(N[(N[(-4.0 * N[(N[Min[t, a], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[Max[t, a], $MachinePrecision] + N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \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{if}\;z \leq -2.2 \cdot 10^{+202}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+160}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot \left(\mathsf{min}\left(t, a\right) \cdot z\right), \mathsf{max}\left(t, a\right), \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.1999999999999998e202 or 2.1999999999999999e160 < z Initial program 80.2%
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
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites72.5%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6463.0%
Applied rewrites63.0%
if -2.1999999999999998e202 < z < 2.1999999999999999e160Initial program 80.2%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-neg-inN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
lower-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6480.3%
Applied rewrites80.3%
(FPCore (x y z t a b c) :precision binary64 (/ (fma (* 9.0 x) y (fma -4.0 (* (* a t) z) b)) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma((9.0 * x), y, fma(-4.0, ((a * t) * z), b)) / (z * c);
}
function code(x, y, z, t, a, b, c) return Float64(fma(Float64(9.0 * x), y, fma(-4.0, Float64(Float64(a * t) * z), b)) / Float64(z * c)) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(9.0 * x), $MachinePrecision] * y + N[(-4.0 * N[(N[(a * t), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\frac{\mathsf{fma}\left(9 \cdot x, y, \mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)\right)}{z \cdot c}
Initial program 80.2%
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 rewrites81.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -1.7e-9)
(/ (fma (* 9.0 x) y (* -4.0 (* a (* t z)))) (* z c))
(if (<= t_1 5e-99)
(fma -4.0 (/ (* a t) c) (/ b (* c z)))
(/ (fma 9.0 (/ (* x y) c) (/ b 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 <= -1.7e-9) {
tmp = fma((9.0 * x), y, (-4.0 * (a * (t * z)))) / (z * c);
} else if (t_1 <= 5e-99) {
tmp = fma(-4.0, ((a * t) / c), (b / (c * z)));
} else {
tmp = fma(9.0, ((x * y) / c), (b / 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 <= -1.7e-9) tmp = Float64(fma(Float64(9.0 * x), y, Float64(-4.0 * Float64(a * Float64(t * z)))) / Float64(z * c)); elseif (t_1 <= 5e-99) tmp = fma(-4.0, Float64(Float64(a * t) / c), Float64(b / Float64(c * z))); else tmp = Float64(fma(9.0, Float64(Float64(x * y) / c), Float64(b / c)) / z); 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, -1.7e-9], N[(N[(N[(9.0 * x), $MachinePrecision] * y + N[(-4.0 * N[(a * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-99], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / c), $MachinePrecision] + N[(b / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -1.7 \cdot 10^{-9}:\\
\;\;\;\;\frac{\mathsf{fma}\left(9 \cdot x, y, -4 \cdot \left(a \cdot \left(t \cdot z\right)\right)\right)}{z \cdot c}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-99}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(9, \frac{x \cdot y}{c}, \frac{b}{c}\right)}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.6999999999999999e-9Initial program 80.2%
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 rewrites81.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6457.2%
Applied rewrites57.2%
if -1.6999999999999999e-9 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.9999999999999997e-99Initial program 80.2%
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
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites72.5%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6463.0%
Applied rewrites63.0%
if 4.9999999999999997e-99 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.2%
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
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites72.5%
Taylor expanded in z around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6459.6%
Applied rewrites59.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* (fmin x y) 9.0) (fmax x y)))
(t_2 (/ (fma 9.0 (/ (* (fmin x y) (fmax x y)) c) (/ b c)) z)))
(if (<= t_1 -4e+263)
(* (/ (* 9.0 (fmin x y)) c) (/ (fmax x y) z))
(if (<= t_1 -1.7e-9)
t_2
(if (<= t_1 5e-99)
(fma -4.0 (/ (* a t) c) (/ b (* c z)))
t_2)))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (fmin(x, y) * 9.0) * fmax(x, y);
double t_2 = fma(9.0, ((fmin(x, y) * fmax(x, y)) / c), (b / c)) / z;
double tmp;
if (t_1 <= -4e+263) {
tmp = ((9.0 * fmin(x, y)) / c) * (fmax(x, y) / z);
} else if (t_1 <= -1.7e-9) {
tmp = t_2;
} else if (t_1 <= 5e-99) {
tmp = fma(-4.0, ((a * t) / c), (b / (c * z)));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(fmin(x, y) * 9.0) * fmax(x, y)) t_2 = Float64(fma(9.0, Float64(Float64(fmin(x, y) * fmax(x, y)) / c), Float64(b / c)) / z) tmp = 0.0 if (t_1 <= -4e+263) tmp = Float64(Float64(Float64(9.0 * fmin(x, y)) / c) * Float64(fmax(x, y) / z)); elseif (t_1 <= -1.7e-9) tmp = t_2; elseif (t_1 <= 5e-99) tmp = fma(-4.0, Float64(Float64(a * t) / c), Float64(b / Float64(c * z))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[Min[x, y], $MachinePrecision] * 9.0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(9.0 * N[(N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] + N[(b / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+263], N[(N[(N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1.7e-9], t$95$2, If[LessEqual[t$95$1, 5e-99], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \left(\mathsf{min}\left(x, y\right) \cdot 9\right) \cdot \mathsf{max}\left(x, y\right)\\
t_2 := \frac{\mathsf{fma}\left(9, \frac{\mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)}{c}, \frac{b}{c}\right)}{z}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+263}:\\
\;\;\;\;\frac{9 \cdot \mathsf{min}\left(x, y\right)}{c} \cdot \frac{\mathsf{max}\left(x, y\right)}{z}\\
\mathbf{elif}\;t\_1 \leq -1.7 \cdot 10^{-9}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-99}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -4.0000000000000001e263Initial program 80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6436.7%
Applied rewrites36.7%
if -4.0000000000000001e263 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.6999999999999999e-9 or 4.9999999999999997e-99 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.2%
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
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites72.5%
Taylor expanded in z around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6459.6%
Applied rewrites59.6%
if -1.6999999999999999e-9 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.9999999999999997e-99Initial program 80.2%
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
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites72.5%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6463.0%
Applied rewrites63.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (/ (+ b (* 9.0 (* x y))) (* z c))))
(if (<= t_1 -1.7e-9)
t_2
(if (<= t_1 5e-99) (fma -4.0 (/ (* a t) c) (/ b (* c z))) 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 = (b + (9.0 * (x * y))) / (z * c);
double tmp;
if (t_1 <= -1.7e-9) {
tmp = t_2;
} else if (t_1 <= 5e-99) {
tmp = fma(-4.0, ((a * t) / c), (b / (c * z)));
} 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(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)) tmp = 0.0 if (t_1 <= -1.7e-9) tmp = t_2; elseif (t_1 <= 5e-99) tmp = fma(-4.0, Float64(Float64(a * t) / c), Float64(b / Float64(c * z))); else tmp = t_2; end return 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[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1.7e-9], t$95$2, If[LessEqual[t$95$1, 5e-99], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := \frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{if}\;t\_1 \leq -1.7 \cdot 10^{-9}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-99}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.6999999999999999e-9 or 4.9999999999999997e-99 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.2%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6460.4%
Applied rewrites60.4%
if -1.6999999999999999e-9 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.9999999999999997e-99Initial program 80.2%
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
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites72.5%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6463.0%
Applied rewrites63.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (/ (+ b (* 9.0 (* x y))) (* z c))))
(if (<= t_1 -500.0)
t_2
(if (<= t_1 1e-46) (/ (fma (* -4.0 (* t z)) a b) (* z 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 = (b + (9.0 * (x * y))) / (z * c);
double tmp;
if (t_1 <= -500.0) {
tmp = t_2;
} else if (t_1 <= 1e-46) {
tmp = fma((-4.0 * (t * z)), a, b) / (z * 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(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)) tmp = 0.0 if (t_1 <= -500.0) tmp = t_2; elseif (t_1 <= 1e-46) tmp = Float64(fma(Float64(-4.0 * Float64(t * z)), a, b) / Float64(z * c)); else tmp = t_2; end return 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[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -500.0], t$95$2, If[LessEqual[t$95$1, 1e-46], N[(N[(N[(-4.0 * N[(t * z), $MachinePrecision]), $MachinePrecision] * a + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := \frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{if}\;t\_1 \leq -500:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{-46}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot \left(t \cdot z\right), a, b\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -500 or 1e-46 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.2%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6460.4%
Applied rewrites60.4%
if -500 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1e-46Initial program 80.2%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-neg-inN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
lower-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6480.3%
Applied rewrites80.3%
Taylor expanded in x around 0
Applied rewrites57.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (/ (* a t) c))))
(if (<= z -2.9e-11)
t_1
(if (<= z 1.75e+161) (/ (+ b (* 9.0 (* x y))) (* z c)) t_1))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * ((a * t) / c);
double tmp;
if (z <= -2.9e-11) {
tmp = t_1;
} else if (z <= 1.75e+161) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} 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) * ((a * t) / c)
if (z <= (-2.9d-11)) then
tmp = t_1
else if (z <= 1.75d+161) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
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 * ((a * t) / c);
double tmp;
if (z <= -2.9e-11) {
tmp = t_1;
} else if (z <= 1.75e+161) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = -4.0 * ((a * t) / c) tmp = 0 if z <= -2.9e-11: tmp = t_1 elif z <= 1.75e+161: tmp = (b + (9.0 * (x * y))) / (z * c) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(Float64(a * t) / c)) tmp = 0.0 if (z <= -2.9e-11) tmp = t_1; elseif (z <= 1.75e+161) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = -4.0 * ((a * t) / c); tmp = 0.0; if (z <= -2.9e-11) tmp = t_1; elseif (z <= 1.75e+161) tmp = (b + (9.0 * (x * y))) / (z * c); 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[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e-11], t$95$1, If[LessEqual[z, 1.75e+161], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+161}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.9e-11 or 1.7499999999999999e161 < z Initial program 80.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if -2.9e-11 < z < 1.7499999999999999e161Initial program 80.2%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6460.4%
Applied rewrites60.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -1e-8)
(* x (/ (* 9.0 y) (* z c)))
(if (<= t_1 0.0)
(/ b (* c z))
(if (<= t_1 1e-24)
(* -4.0 (/ (* a t) c))
(/ (/ (* (* x y) 9.0) 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-8) {
tmp = x * ((9.0 * y) / (z * c));
} else if (t_1 <= 0.0) {
tmp = b / (c * z);
} else if (t_1 <= 1e-24) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = (((x * y) * 9.0) / 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-8)) then
tmp = x * ((9.0d0 * y) / (z * c))
else if (t_1 <= 0.0d0) then
tmp = b / (c * z)
else if (t_1 <= 1d-24) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = (((x * y) * 9.0d0) / 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-8) {
tmp = x * ((9.0 * y) / (z * c));
} else if (t_1 <= 0.0) {
tmp = b / (c * z);
} else if (t_1 <= 1e-24) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = (((x * y) * 9.0) / 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-8: tmp = x * ((9.0 * y) / (z * c)) elif t_1 <= 0.0: tmp = b / (c * z) elif t_1 <= 1e-24: tmp = -4.0 * ((a * t) / c) else: tmp = (((x * y) * 9.0) / 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-8) tmp = Float64(x * Float64(Float64(9.0 * y) / Float64(z * c))); elseif (t_1 <= 0.0) tmp = Float64(b / Float64(c * z)); elseif (t_1 <= 1e-24) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(Float64(Float64(Float64(x * y) * 9.0) / 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-8) tmp = x * ((9.0 * y) / (z * c)); elseif (t_1 <= 0.0) tmp = b / (c * z); elseif (t_1 <= 1e-24) tmp = -4.0 * ((a * t) / c); else tmp = (((x * y) * 9.0) / 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-8], N[(x * N[(N[(9.0 * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-24], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * y), $MachinePrecision] * 9.0), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-8}:\\
\;\;\;\;x \cdot \frac{9 \cdot y}{z \cdot c}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq 10^{-24}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(x \cdot y\right) \cdot 9}{c}}{z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e-8Initial program 80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6437.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6437.8%
Applied rewrites37.8%
if -1e-8 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 0.0Initial program 80.2%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.4%
Applied rewrites35.4%
if 0.0 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999992e-25Initial program 80.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if 9.9999999999999992e-25 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.2%
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 rewrites81.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6436.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6436.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6436.1%
Applied rewrites36.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 9.0 (fmin x y))))
(if (<= (fmax x y) -4.3e-85)
(* (/ t_1 c) (/ (fmax x y) z))
(if (<= (fmax x y) 4.8e-169)
(/ b (* c z))
(if (<= (fmax x y) 1.02e+124)
(* -4.0 (/ (* a t) c))
(* t_1 (/ (fmax x y) (* z c))))))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 9.0 * fmin(x, y);
double tmp;
if (fmax(x, y) <= -4.3e-85) {
tmp = (t_1 / c) * (fmax(x, y) / z);
} else if (fmax(x, y) <= 4.8e-169) {
tmp = b / (c * z);
} else if (fmax(x, y) <= 1.02e+124) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = t_1 * (fmax(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) :: t_1
real(8) :: tmp
t_1 = 9.0d0 * fmin(x, y)
if (fmax(x, y) <= (-4.3d-85)) then
tmp = (t_1 / c) * (fmax(x, y) / z)
else if (fmax(x, y) <= 4.8d-169) then
tmp = b / (c * z)
else if (fmax(x, y) <= 1.02d+124) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = t_1 * (fmax(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 t_1 = 9.0 * fmin(x, y);
double tmp;
if (fmax(x, y) <= -4.3e-85) {
tmp = (t_1 / c) * (fmax(x, y) / z);
} else if (fmax(x, y) <= 4.8e-169) {
tmp = b / (c * z);
} else if (fmax(x, y) <= 1.02e+124) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = t_1 * (fmax(x, y) / (z * c));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 9.0 * fmin(x, y) tmp = 0 if fmax(x, y) <= -4.3e-85: tmp = (t_1 / c) * (fmax(x, y) / z) elif fmax(x, y) <= 4.8e-169: tmp = b / (c * z) elif fmax(x, y) <= 1.02e+124: tmp = -4.0 * ((a * t) / c) else: tmp = t_1 * (fmax(x, y) / (z * c)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(9.0 * fmin(x, y)) tmp = 0.0 if (fmax(x, y) <= -4.3e-85) tmp = Float64(Float64(t_1 / c) * Float64(fmax(x, y) / z)); elseif (fmax(x, y) <= 4.8e-169) tmp = Float64(b / Float64(c * z)); elseif (fmax(x, y) <= 1.02e+124) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(t_1 * Float64(fmax(x, y) / Float64(z * c))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 9.0 * min(x, y); tmp = 0.0; if (max(x, y) <= -4.3e-85) tmp = (t_1 / c) * (max(x, y) / z); elseif (max(x, y) <= 4.8e-169) tmp = b / (c * z); elseif (max(x, y) <= 1.02e+124) tmp = -4.0 * ((a * t) / c); else tmp = t_1 * (max(x, y) / (z * c)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(9.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], -4.3e-85], N[(N[(t$95$1 / c), $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 4.8e-169], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 1.02e+124], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[Max[x, y], $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := 9 \cdot \mathsf{min}\left(x, y\right)\\
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq -4.3 \cdot 10^{-85}:\\
\;\;\;\;\frac{t\_1}{c} \cdot \frac{\mathsf{max}\left(x, y\right)}{z}\\
\mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 4.8 \cdot 10^{-169}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 1.02 \cdot 10^{+124}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{\mathsf{max}\left(x, y\right)}{z \cdot c}\\
\end{array}
if y < -4.3e-85Initial program 80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6436.7%
Applied rewrites36.7%
if -4.3e-85 < y < 4.8000000000000002e-169Initial program 80.2%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.4%
Applied rewrites35.4%
if 4.8000000000000002e-169 < y < 1.0199999999999999e124Initial program 80.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if 1.0199999999999999e124 < y Initial program 80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6437.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6437.8%
Applied rewrites37.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -1e-8)
(* x (/ (* 9.0 y) (* z c)))
(if (<= t_1 0.0)
(/ b (* c z))
(if (<= t_1 1e-24)
(* -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-8) {
tmp = x * ((9.0 * y) / (z * c));
} else if (t_1 <= 0.0) {
tmp = b / (c * z);
} else if (t_1 <= 1e-24) {
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-8)) then
tmp = x * ((9.0d0 * y) / (z * c))
else if (t_1 <= 0.0d0) then
tmp = b / (c * z)
else if (t_1 <= 1d-24) 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-8) {
tmp = x * ((9.0 * y) / (z * c));
} else if (t_1 <= 0.0) {
tmp = b / (c * z);
} else if (t_1 <= 1e-24) {
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-8: tmp = x * ((9.0 * y) / (z * c)) elif t_1 <= 0.0: tmp = b / (c * z) elif t_1 <= 1e-24: 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-8) tmp = Float64(x * Float64(Float64(9.0 * y) / Float64(z * c))); elseif (t_1 <= 0.0) tmp = Float64(b / Float64(c * z)); elseif (t_1 <= 1e-24) tmp = Float64(-4.0 * Float64(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-8) tmp = x * ((9.0 * y) / (z * c)); elseif (t_1 <= 0.0) tmp = b / (c * z); elseif (t_1 <= 1e-24) 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-8], N[(x * N[(N[(9.0 * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-24], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $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^{-8}:\\
\;\;\;\;x \cdot \frac{9 \cdot y}{z \cdot c}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq 10^{-24}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{c \cdot z}\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e-8Initial program 80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6437.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6437.8%
Applied rewrites37.8%
if -1e-8 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 0.0Initial program 80.2%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.4%
Applied rewrites35.4%
if 0.0 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999992e-25Initial program 80.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if 9.9999999999999992e-25 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
(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-8)
t_2
(if (<= t_1 0.0)
(/ b (* c z))
(if (<= t_1 1e-13) (* -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-8) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = b / (c * z);
} else if (t_1 <= 1e-13) {
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-8)) then
tmp = t_2
else if (t_1 <= 0.0d0) then
tmp = b / (c * z)
else if (t_1 <= 1d-13) 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-8) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = b / (c * z);
} else if (t_1 <= 1e-13) {
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-8: tmp = t_2 elif t_1 <= 0.0: tmp = b / (c * z) elif t_1 <= 1e-13: 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-8) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(b / Float64(c * z)); elseif (t_1 <= 1e-13) tmp = Float64(-4.0 * Float64(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-8) tmp = t_2; elseif (t_1 <= 0.0) tmp = b / (c * z); elseif (t_1 <= 1e-13) 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-8], t$95$2, If[LessEqual[t$95$1, 0.0], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-13], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $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^{-8}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq 10^{-13}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e-8 or 1e-13 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
if -1e-8 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 0.0Initial program 80.2%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.4%
Applied rewrites35.4%
if 0.0 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1e-13Initial program 80.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
(FPCore (x y z t a b c) :precision binary64 (if (<= b -9.2e+63) (/ (/ 1.0 (/ c b)) z) (if (<= b 2.6e+175) (* -4.0 (/ (* a t) c)) (/ b (* c z)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -9.2e+63) {
tmp = (1.0 / (c / b)) / z;
} else if (b <= 2.6e+175) {
tmp = -4.0 * ((a * t) / c);
} 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 (b <= (-9.2d+63)) then
tmp = (1.0d0 / (c / b)) / z
else if (b <= 2.6d+175) then
tmp = (-4.0d0) * ((a * t) / c)
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 (b <= -9.2e+63) {
tmp = (1.0 / (c / b)) / z;
} else if (b <= 2.6e+175) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = b / (c * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if b <= -9.2e+63: tmp = (1.0 / (c / b)) / z elif b <= 2.6e+175: tmp = -4.0 * ((a * t) / c) else: tmp = b / (c * z) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -9.2e+63) tmp = Float64(Float64(1.0 / Float64(c / b)) / z); elseif (b <= 2.6e+175) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); 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 (b <= -9.2e+63) tmp = (1.0 / (c / b)) / z; elseif (b <= 2.6e+175) tmp = -4.0 * ((a * t) / c); else tmp = b / (c * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -9.2e+63], N[(N[(1.0 / N[(c / b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[b, 2.6e+175], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;b \leq -9.2 \cdot 10^{+63}:\\
\;\;\;\;\frac{\frac{1}{\frac{c}{b}}}{z}\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{+175}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\end{array}
if b < -9.1999999999999997e63Initial program 80.2%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.4%
Applied rewrites35.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6434.6%
Applied rewrites34.6%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6434.5%
Applied rewrites34.5%
if -9.1999999999999997e63 < b < 2.6e175Initial program 80.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if 2.6e175 < b Initial program 80.2%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.4%
Applied rewrites35.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z))))
(if (<= b -9.2e+63)
t_1
(if (<= b 2.6e+175) (* -4.0 (/ (* a t) c)) t_1))))double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double tmp;
if (b <= -9.2e+63) {
tmp = t_1;
} else if (b <= 2.6e+175) {
tmp = -4.0 * ((a * t) / c);
} 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 = b / (c * z)
if (b <= (-9.2d+63)) then
tmp = t_1
else if (b <= 2.6d+175) then
tmp = (-4.0d0) * ((a * t) / c)
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 = b / (c * z);
double tmp;
if (b <= -9.2e+63) {
tmp = t_1;
} else if (b <= 2.6e+175) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b / (c * z) tmp = 0 if b <= -9.2e+63: tmp = t_1 elif b <= 2.6e+175: tmp = -4.0 * ((a * t) / c) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) tmp = 0.0 if (b <= -9.2e+63) tmp = t_1; elseif (b <= 2.6e+175) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b / (c * z); tmp = 0.0; if (b <= -9.2e+63) tmp = t_1; elseif (b <= 2.6e+175) tmp = -4.0 * ((a * t) / c); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -9.2e+63], t$95$1, If[LessEqual[b, 2.6e+175], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
\mathbf{if}\;b \leq -9.2 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{+175}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -9.1999999999999997e63 or 2.6e175 < b Initial program 80.2%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.4%
Applied rewrites35.4%
if -9.1999999999999997e63 < b < 2.6e175Initial program 80.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8%
Applied rewrites38.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 80.2%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.4%
Applied rewrites35.4%
herbie shell --seed 2025212
(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)))