
(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]
\begin{array}{l}
\\
\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}
\end{array}
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]
\begin{array}{l}
\\
\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}
\end{array}
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -2.9e+48)
(/ (fma -4.0 (* a t) (/ (fma (* 9.0 y) x b) z)) c)
(if (<= z 3.2e-6)
(/ (+ (- (* x (* 9.0 y)) (* (* (* z 4.0) t) a)) b) (* z c))
(/ (fma -4.0 (* a t) (* (fma 9.0 (/ y z) (/ b (* z x))) x)) c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2.9e+48) {
tmp = fma(-4.0, (a * t), (fma((9.0 * y), x, b) / z)) / c;
} else if (z <= 3.2e-6) {
tmp = (((x * (9.0 * y)) - (((z * 4.0) * t) * a)) + b) / (z * c);
} else {
tmp = fma(-4.0, (a * t), (fma(9.0, (y / z), (b / (z * x))) * x)) / c;
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -2.9e+48) tmp = Float64(fma(-4.0, Float64(a * t), Float64(fma(Float64(9.0 * y), x, b) / z)) / c); elseif (z <= 3.2e-6) tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)); else tmp = Float64(fma(-4.0, Float64(a * t), Float64(fma(9.0, Float64(y / z), Float64(b / Float64(z * x))) * x)) / c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -2.9e+48], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(N[(N[(9.0 * y), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 3.2e-6], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(N[(9.0 * N[(y / z), $MachinePrecision] + N[(b / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+48}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{\mathsf{fma}\left(9 \cdot y, x, b\right)}{z}\right)}{c}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{\left(x \cdot \left(9 \cdot y\right) - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{y}{z}, \frac{b}{z \cdot x}\right) \cdot x\right)}{c}\\
\end{array}
\end{array}
if z < -2.8999999999999999e48Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Applied rewrites86.5%
if -2.8999999999999999e48 < z < 3.1999999999999999e-6Initial program 79.3%
Applied rewrites79.3%
if 3.1999999999999999e-6 < z Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Applied rewrites86.5%
Taylor expanded in x around inf
Applied rewrites78.0%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -2.9e+48)
(/ (fma -4.0 (* a t) (/ (fma (* 9.0 y) x b) z)) c)
(if (<= z 1e-15)
(/ (+ (- (* x (* 9.0 y)) (* (* (* z 4.0) t) a)) b) (* z c))
(/ (fma -4.0 (* a t) (* (fma 9.0 (/ x z) (/ b (* z y))) y)) c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2.9e+48) {
tmp = fma(-4.0, (a * t), (fma((9.0 * y), x, b) / z)) / c;
} else if (z <= 1e-15) {
tmp = (((x * (9.0 * y)) - (((z * 4.0) * t) * a)) + b) / (z * c);
} else {
tmp = fma(-4.0, (a * t), (fma(9.0, (x / z), (b / (z * y))) * y)) / c;
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -2.9e+48) tmp = Float64(fma(-4.0, Float64(a * t), Float64(fma(Float64(9.0 * y), x, b) / z)) / c); elseif (z <= 1e-15) tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)); else tmp = Float64(fma(-4.0, Float64(a * t), Float64(fma(9.0, Float64(x / z), Float64(b / Float64(z * y))) * y)) / c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -2.9e+48], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(N[(N[(9.0 * y), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 1e-15], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(N[(9.0 * N[(x / z), $MachinePrecision] + N[(b / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+48}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{\mathsf{fma}\left(9 \cdot y, x, b\right)}{z}\right)}{c}\\
\mathbf{elif}\;z \leq 10^{-15}:\\
\;\;\;\;\frac{\left(x \cdot \left(9 \cdot y\right) - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(9, \frac{x}{z}, \frac{b}{z \cdot y}\right) \cdot y\right)}{c}\\
\end{array}
\end{array}
if z < -2.8999999999999999e48Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Applied rewrites86.5%
if -2.8999999999999999e48 < z < 1.0000000000000001e-15Initial program 79.3%
Applied rewrites79.3%
if 1.0000000000000001e-15 < z Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Applied rewrites86.5%
Taylor expanded in y around inf
Applied rewrites78.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (fma -4.0 (* a t) (/ (fma (* 9.0 y) x b) z)) c)))
(if (<= z -2.9e+48)
t_1
(if (<= z 6e-128)
(/ (+ (- (* x (* 9.0 y)) (* (* (* z 4.0) t) a)) 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, (a * t), (fma((9.0 * y), x, b) / z)) / c;
double tmp;
if (z <= -2.9e+48) {
tmp = t_1;
} else if (z <= 6e-128) {
tmp = (((x * (9.0 * y)) - (((z * 4.0) * t) * a)) + b) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(fma(-4.0, Float64(a * t), Float64(fma(Float64(9.0 * y), x, b) / z)) / c) tmp = 0.0 if (z <= -2.9e+48) tmp = t_1; elseif (z <= 6e-128) tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(Float64(z * 4.0) * t) * a)) + 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[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(N[(N[(9.0 * y), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -2.9e+48], t$95$1, If[LessEqual[z, 6e-128], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{\mathsf{fma}\left(9 \cdot y, x, b\right)}{z}\right)}{c}\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-128}:\\
\;\;\;\;\frac{\left(x \cdot \left(9 \cdot y\right) - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.8999999999999999e48 or 5.99999999999999956e-128 < z Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Applied rewrites86.5%
if -2.8999999999999999e48 < z < 5.99999999999999956e-128Initial program 79.3%
Applied rewrites79.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (fma -4.0 (* a t) (/ (fma (* 9.0 y) x b) z)) c)))
(if (<= z -2.9e+48)
t_1
(if (<= z 6e-128)
(/ (+ (fma (* x 9.0) y (* (* (* t z) a) -4.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, (a * t), (fma((9.0 * y), x, b) / z)) / c;
double tmp;
if (z <= -2.9e+48) {
tmp = t_1;
} else if (z <= 6e-128) {
tmp = (fma((x * 9.0), y, (((t * z) * a) * -4.0)) + b) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(fma(-4.0, Float64(a * t), Float64(fma(Float64(9.0 * y), x, b) / z)) / c) tmp = 0.0 if (z <= -2.9e+48) tmp = t_1; elseif (z <= 6e-128) tmp = Float64(Float64(fma(Float64(x * 9.0), y, Float64(Float64(Float64(t * z) * a) * -4.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[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(N[(N[(9.0 * y), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -2.9e+48], t$95$1, If[LessEqual[z, 6e-128], N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y + N[(N[(N[(t * z), $MachinePrecision] * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{\mathsf{fma}\left(9 \cdot y, x, b\right)}{z}\right)}{c}\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-128}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x \cdot 9, y, \left(\left(t \cdot z\right) \cdot a\right) \cdot -4\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.8999999999999999e48 or 5.99999999999999956e-128 < z Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Applied rewrites86.5%
if -2.8999999999999999e48 < z < 5.99999999999999956e-128Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites79.7%
(FPCore (x y z t a b c)
:precision binary64
(if (<= t -4.2e-6)
(/ (fma -4.0 (* a t) (/ (fma (* 9.0 y) x b) z)) c)
(if (<= t 360000000000.0)
(fma (/ (* a t) c) -4.0 (/ (fma (* x 9.0) y b) (* z c)))
(- (* (/ (- (* 4.0 t) (/ b (* a z))) c) a)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -4.2e-6) {
tmp = fma(-4.0, (a * t), (fma((9.0 * y), x, b) / z)) / c;
} else if (t <= 360000000000.0) {
tmp = fma(((a * t) / c), -4.0, (fma((x * 9.0), y, b) / (z * c)));
} else {
tmp = -((((4.0 * t) - (b / (a * z))) / c) * a);
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (t <= -4.2e-6) tmp = Float64(fma(-4.0, Float64(a * t), Float64(fma(Float64(9.0 * y), x, b) / z)) / c); elseif (t <= 360000000000.0) tmp = fma(Float64(Float64(a * t) / c), -4.0, Float64(fma(Float64(x * 9.0), y, b) / Float64(z * c))); else tmp = Float64(-Float64(Float64(Float64(Float64(4.0 * t) - Float64(b / Float64(a * z))) / c) * a)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[t, -4.2e-6], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(N[(N[(9.0 * y), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t, 360000000000.0], N[(N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] * -4.0 + N[(N[(N[(x * 9.0), $MachinePrecision] * y + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(N[(N[(N[(4.0 * t), $MachinePrecision] - N[(b / N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] * a), $MachinePrecision])]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{\mathsf{fma}\left(9 \cdot y, x, b\right)}{z}\right)}{c}\\
\mathbf{elif}\;t \leq 360000000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{a \cdot t}{c}, -4, \frac{\mathsf{fma}\left(x \cdot 9, y, b\right)}{z \cdot c}\right)\\
\mathbf{else}:\\
\;\;\;\;-\frac{4 \cdot t - \frac{b}{a \cdot z}}{c} \cdot a\\
\end{array}
\end{array}
if t < -4.1999999999999996e-6Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Applied rewrites86.5%
if -4.1999999999999996e-6 < t < 3.6e11Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
if 3.6e11 < t Initial program 79.3%
Taylor expanded in a around -inf
Applied rewrites78.3%
Taylor expanded in x around 0
Applied rewrites60.0%
Taylor expanded in c around 0
Applied rewrites61.3%
(FPCore (x y z t a b c) :precision binary64 (if (<= c 1.9e+233) (/ (fma -4.0 (* a t) (/ (fma (* 9.0 y) x b) z)) c) (fma (* a (/ t c)) -4.0 (/ b (* z c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (c <= 1.9e+233) {
tmp = fma(-4.0, (a * t), (fma((9.0 * y), x, b) / z)) / c;
} else {
tmp = fma((a * (t / c)), -4.0, (b / (z * c)));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (c <= 1.9e+233) tmp = Float64(fma(-4.0, Float64(a * t), Float64(fma(Float64(9.0 * y), x, b) / z)) / c); else tmp = fma(Float64(a * Float64(t / c)), -4.0, Float64(b / Float64(z * c))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[c, 1.9e+233], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(N[(N[(9.0 * y), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq 1.9 \cdot 10^{+233}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{\mathsf{fma}\left(9 \cdot y, x, b\right)}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot \frac{t}{c}, -4, \frac{b}{z \cdot c}\right)\\
\end{array}
\end{array}
if c < 1.8999999999999999e233Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Applied rewrites86.5%
if 1.8999999999999999e233 < c Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Taylor expanded in x around 0
Applied rewrites62.7%
Applied rewrites62.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y))
(t_2 (/ (fma -4.0 (* a t) (* (/ (* 9.0 y) z) x)) c)))
(if (<= t_1 -1e-102)
t_2
(if (<= t_1 5e+37) (- (* (/ (- (* 4.0 t) (/ b (* a z))) c) a)) 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 = fma(-4.0, (a * t), (((9.0 * y) / z) * x)) / c;
double tmp;
if (t_1 <= -1e-102) {
tmp = t_2;
} else if (t_1 <= 5e+37) {
tmp = -((((4.0 * t) - (b / (a * z))) / c) * a);
} 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(fma(-4.0, Float64(a * t), Float64(Float64(Float64(9.0 * y) / z) * x)) / c) tmp = 0.0 if (t_1 <= -1e-102) tmp = t_2; elseif (t_1 <= 5e+37) tmp = Float64(-Float64(Float64(Float64(Float64(4.0 * t) - Float64(b / Float64(a * z))) / c) * a)); 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[(-4.0 * N[(a * t), $MachinePrecision] + N[(N[(N[(9.0 * y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-102], t$95$2, If[LessEqual[t$95$1, 5e+37], (-N[(N[(N[(N[(4.0 * t), $MachinePrecision] - N[(b / N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] * a), $MachinePrecision]), t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{9 \cdot y}{z} \cdot x\right)}{c}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-102}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+37}:\\
\;\;\;\;-\frac{4 \cdot t - \frac{b}{a \cdot z}}{c} \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -9.99999999999999933e-103 or 4.99999999999999989e37 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Applied rewrites86.5%
Taylor expanded in x around inf
Applied rewrites78.0%
Taylor expanded in x around inf
Applied rewrites64.9%
if -9.99999999999999933e-103 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.99999999999999989e37Initial program 79.3%
Taylor expanded in a around -inf
Applied rewrites78.3%
Taylor expanded in x around 0
Applied rewrites60.0%
Taylor expanded in c around 0
Applied rewrites61.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y))
(t_2 (/ (fma (/ (* y x) z) 9.0 (* -4.0 (* a t))) c)))
(if (<= t_1 -1e-102)
t_2
(if (<= t_1 5e+37) (- (* (/ (- (* 4.0 t) (/ b (* a z))) c) a)) 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 = fma(((y * x) / z), 9.0, (-4.0 * (a * t))) / c;
double tmp;
if (t_1 <= -1e-102) {
tmp = t_2;
} else if (t_1 <= 5e+37) {
tmp = -((((4.0 * t) - (b / (a * z))) / c) * a);
} 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(fma(Float64(Float64(y * x) / z), 9.0, Float64(-4.0 * Float64(a * t))) / c) tmp = 0.0 if (t_1 <= -1e-102) tmp = t_2; elseif (t_1 <= 5e+37) tmp = Float64(-Float64(Float64(Float64(Float64(4.0 * t) - Float64(b / Float64(a * z))) / c) * a)); 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[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] * 9.0 + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-102], t$95$2, If[LessEqual[t$95$1, 5e+37], (-N[(N[(N[(N[(4.0 * t), $MachinePrecision] - N[(b / N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] * a), $MachinePrecision]), t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := \frac{\mathsf{fma}\left(\frac{y \cdot x}{z}, 9, -4 \cdot \left(a \cdot t\right)\right)}{c}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-102}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+37}:\\
\;\;\;\;-\frac{4 \cdot t - \frac{b}{a \cdot z}}{c} \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -9.99999999999999933e-103 or 4.99999999999999989e37 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Applied rewrites86.5%
Taylor expanded in b around 0
Applied rewrites63.7%
if -9.99999999999999933e-103 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.99999999999999989e37Initial program 79.3%
Taylor expanded in a around -inf
Applied rewrites78.3%
Taylor expanded in x around 0
Applied rewrites60.0%
Taylor expanded in c around 0
Applied rewrites61.3%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -2.05e+27)
(fma (/ (* a t) c) -4.0 (/ b (* z c)))
(if (<= z 5.8e+25)
(/ (fma (* 9.0 y) x b) (* z c))
(/ (fma -4.0 (* a t) (/ b z)) c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2.05e+27) {
tmp = fma(((a * t) / c), -4.0, (b / (z * c)));
} else if (z <= 5.8e+25) {
tmp = fma((9.0 * y), x, b) / (z * c);
} else {
tmp = fma(-4.0, (a * t), (b / z)) / c;
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -2.05e+27) tmp = fma(Float64(Float64(a * t) / c), -4.0, Float64(b / Float64(z * c))); elseif (z <= 5.8e+25) tmp = Float64(fma(Float64(9.0 * y), x, b) / Float64(z * c)); else tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -2.05e+27], N[(N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] * -4.0 + N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+25], N[(N[(N[(9.0 * y), $MachinePrecision] * x + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{+27}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a \cdot t}{c}, -4, \frac{b}{z \cdot c}\right)\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+25}:\\
\;\;\;\;\frac{\mathsf{fma}\left(9 \cdot y, x, b\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
\end{array}
\end{array}
if z < -2.0500000000000001e27Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Taylor expanded in x around 0
Applied rewrites62.7%
if -2.0500000000000001e27 < z < 5.7999999999999998e25Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Taylor expanded in z around 0
Applied rewrites59.9%
if 5.7999999999999998e25 < z Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Applied rewrites86.5%
Taylor expanded in x around 0
Applied rewrites64.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (fma -4.0 (* a t) (/ b z)) c)))
(if (<= z -2.05e+27)
t_1
(if (<= z 5.8e+25) (/ (fma (* 9.0 y) x 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, (a * t), (b / z)) / c;
double tmp;
if (z <= -2.05e+27) {
tmp = t_1;
} else if (z <= 5.8e+25) {
tmp = fma((9.0 * y), x, b) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c) tmp = 0.0 if (z <= -2.05e+27) tmp = t_1; elseif (z <= 5.8e+25) tmp = Float64(fma(Float64(9.0 * y), x, 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[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -2.05e+27], t$95$1, If[LessEqual[z, 5.8e+25], N[(N[(N[(9.0 * y), $MachinePrecision] * x + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
\mathbf{if}\;z \leq -2.05 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+25}:\\
\;\;\;\;\frac{\mathsf{fma}\left(9 \cdot y, x, b\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.0500000000000001e27 or 5.7999999999999998e25 < z Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Applied rewrites86.5%
Taylor expanded in x around 0
Applied rewrites64.2%
if -2.0500000000000001e27 < z < 5.7999999999999998e25Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Taylor expanded in z around 0
Applied rewrites59.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* (* a t) -4.0) c)))
(if (<= z -1.1e+145)
t_1
(if (<= z 2.35e+140) (/ (fma (* 9.0 y) x b) (* z c)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((a * t) * -4.0) / c;
double tmp;
if (z <= -1.1e+145) {
tmp = t_1;
} else if (z <= 2.35e+140) {
tmp = fma((9.0 * y), x, b) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(a * t) * -4.0) / c) tmp = 0.0 if (z <= -1.1e+145) tmp = t_1; elseif (z <= 2.35e+140) tmp = Float64(fma(Float64(9.0 * y), x, 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[(N[(N[(a * t), $MachinePrecision] * -4.0), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -1.1e+145], t$95$1, If[LessEqual[z, 2.35e+140], N[(N[(N[(9.0 * y), $MachinePrecision] * x + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(a \cdot t\right) \cdot -4}{c}\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{+140}:\\
\;\;\;\;\frac{\mathsf{fma}\left(9 \cdot y, x, b\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.10000000000000004e145 or 2.35000000000000015e140 < z Initial program 79.3%
Taylor expanded in z around inf
Applied rewrites38.7%
if -1.10000000000000004e145 < z < 2.35000000000000015e140Initial program 79.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Taylor expanded in z around 0
Applied rewrites59.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -4e+146)
(* (/ (* y x) (* z c)) 9.0)
(if (<= t_1 5e+85)
(- (* (/ (* 4.0 t) c) a))
(/ (* (/ (* y x) z) 9.0) 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 <= -4e+146) {
tmp = ((y * x) / (z * c)) * 9.0;
} else if (t_1 <= 5e+85) {
tmp = -(((4.0 * t) / c) * a);
} else {
tmp = (((y * x) / z) * 9.0) / 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 = (x * 9.0d0) * y
if (t_1 <= (-4d+146)) then
tmp = ((y * x) / (z * c)) * 9.0d0
else if (t_1 <= 5d+85) then
tmp = -(((4.0d0 * t) / c) * a)
else
tmp = (((y * x) / z) * 9.0d0) / 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 = (x * 9.0) * y;
double tmp;
if (t_1 <= -4e+146) {
tmp = ((y * x) / (z * c)) * 9.0;
} else if (t_1 <= 5e+85) {
tmp = -(((4.0 * t) / c) * a);
} else {
tmp = (((y * x) / z) * 9.0) / c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y tmp = 0 if t_1 <= -4e+146: tmp = ((y * x) / (z * c)) * 9.0 elif t_1 <= 5e+85: tmp = -(((4.0 * t) / c) * a) else: tmp = (((y * x) / z) * 9.0) / 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 <= -4e+146) tmp = Float64(Float64(Float64(y * x) / Float64(z * c)) * 9.0); elseif (t_1 <= 5e+85) tmp = Float64(-Float64(Float64(Float64(4.0 * t) / c) * a)); else tmp = Float64(Float64(Float64(Float64(y * x) / z) * 9.0) / c); 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 <= -4e+146) tmp = ((y * x) / (z * c)) * 9.0; elseif (t_1 <= 5e+85) tmp = -(((4.0 * t) / c) * a); else tmp = (((y * x) / z) * 9.0) / c; 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, -4e+146], N[(N[(N[(y * x), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+85], (-N[(N[(N[(4.0 * t), $MachinePrecision] / c), $MachinePrecision] * a), $MachinePrecision]), N[(N[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] * 9.0), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+146}:\\
\;\;\;\;\frac{y \cdot x}{z \cdot c} \cdot 9\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+85}:\\
\;\;\;\;-\frac{4 \cdot t}{c} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y \cdot x}{z} \cdot 9}{c}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -3.99999999999999973e146Initial program 79.3%
Taylor expanded in x around inf
Applied rewrites35.7%
Applied rewrites35.7%
if -3.99999999999999973e146 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000001e85Initial program 79.3%
Taylor expanded in a around -inf
Applied rewrites78.3%
Taylor expanded in z around inf
Applied rewrites40.2%
if 5.0000000000000001e85 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.3%
Taylor expanded in x around inf
Applied rewrites35.7%
Applied rewrites34.4%
Applied rewrites34.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -4e+146)
(* (/ (* y x) (* z c)) 9.0)
(if (<= t_1 1e+134)
(- (* (/ (* 4.0 t) c) a))
(/ (* (* 9.0 y) x) (* 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 <= -4e+146) {
tmp = ((y * x) / (z * c)) * 9.0;
} else if (t_1 <= 1e+134) {
tmp = -(((4.0 * t) / c) * a);
} else {
tmp = ((9.0 * y) * x) / (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 = (x * 9.0d0) * y
if (t_1 <= (-4d+146)) then
tmp = ((y * x) / (z * c)) * 9.0d0
else if (t_1 <= 1d+134) then
tmp = -(((4.0d0 * t) / c) * a)
else
tmp = ((9.0d0 * y) * x) / (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 = (x * 9.0) * y;
double tmp;
if (t_1 <= -4e+146) {
tmp = ((y * x) / (z * c)) * 9.0;
} else if (t_1 <= 1e+134) {
tmp = -(((4.0 * t) / c) * a);
} else {
tmp = ((9.0 * y) * x) / (z * c);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y tmp = 0 if t_1 <= -4e+146: tmp = ((y * x) / (z * c)) * 9.0 elif t_1 <= 1e+134: tmp = -(((4.0 * t) / c) * a) else: tmp = ((9.0 * y) * x) / (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 <= -4e+146) tmp = Float64(Float64(Float64(y * x) / Float64(z * c)) * 9.0); elseif (t_1 <= 1e+134) tmp = Float64(-Float64(Float64(Float64(4.0 * t) / c) * a)); else tmp = Float64(Float64(Float64(9.0 * y) * x) / Float64(z * c)); 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 <= -4e+146) tmp = ((y * x) / (z * c)) * 9.0; elseif (t_1 <= 1e+134) tmp = -(((4.0 * t) / c) * a); else tmp = ((9.0 * y) * x) / (z * c); 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, -4e+146], N[(N[(N[(y * x), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+134], (-N[(N[(N[(4.0 * t), $MachinePrecision] / c), $MachinePrecision] * a), $MachinePrecision]), N[(N[(N[(9.0 * y), $MachinePrecision] * x), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+146}:\\
\;\;\;\;\frac{y \cdot x}{z \cdot c} \cdot 9\\
\mathbf{elif}\;t\_1 \leq 10^{+134}:\\
\;\;\;\;-\frac{4 \cdot t}{c} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(9 \cdot y\right) \cdot x}{z \cdot c}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -3.99999999999999973e146Initial program 79.3%
Taylor expanded in x around inf
Applied rewrites35.7%
Applied rewrites35.7%
if -3.99999999999999973e146 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999921e133Initial program 79.3%
Taylor expanded in a around -inf
Applied rewrites78.3%
Taylor expanded in z around inf
Applied rewrites40.2%
if 9.99999999999999921e133 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.3%
Taylor expanded in x around inf
Applied rewrites35.7%
Applied rewrites35.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -4e+146)
(* (/ (* y x) (* z c)) 9.0)
(if (<= t_1 1e+134)
(- (* (/ (* 4.0 t) c) a))
(/ (* (* 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 <= -4e+146) {
tmp = ((y * x) / (z * c)) * 9.0;
} else if (t_1 <= 1e+134) {
tmp = -(((4.0 * t) / c) * a);
} else {
tmp = ((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) :: t_1
real(8) :: tmp
t_1 = (x * 9.0d0) * y
if (t_1 <= (-4d+146)) then
tmp = ((y * x) / (z * c)) * 9.0d0
else if (t_1 <= 1d+134) then
tmp = -(((4.0d0 * t) / c) * a)
else
tmp = ((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 t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -4e+146) {
tmp = ((y * x) / (z * c)) * 9.0;
} else if (t_1 <= 1e+134) {
tmp = -(((4.0 * t) / c) * a);
} else {
tmp = ((9.0 * x) * y) / (z * c);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y tmp = 0 if t_1 <= -4e+146: tmp = ((y * x) / (z * c)) * 9.0 elif t_1 <= 1e+134: tmp = -(((4.0 * t) / c) * a) else: tmp = ((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 <= -4e+146) tmp = Float64(Float64(Float64(y * x) / Float64(z * c)) * 9.0); elseif (t_1 <= 1e+134) tmp = Float64(-Float64(Float64(Float64(4.0 * t) / c) * a)); else tmp = Float64(Float64(Float64(9.0 * x) * y) / Float64(z * c)); 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 <= -4e+146) tmp = ((y * x) / (z * c)) * 9.0; elseif (t_1 <= 1e+134) tmp = -(((4.0 * t) / c) * a); else tmp = ((9.0 * x) * y) / (z * c); 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, -4e+146], N[(N[(N[(y * x), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+134], (-N[(N[(N[(4.0 * t), $MachinePrecision] / c), $MachinePrecision] * a), $MachinePrecision]), N[(N[(N[(9.0 * x), $MachinePrecision] * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+146}:\\
\;\;\;\;\frac{y \cdot x}{z \cdot c} \cdot 9\\
\mathbf{elif}\;t\_1 \leq 10^{+134}:\\
\;\;\;\;-\frac{4 \cdot t}{c} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(9 \cdot x\right) \cdot y}{z \cdot c}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -3.99999999999999973e146Initial program 79.3%
Taylor expanded in x around inf
Applied rewrites35.7%
Applied rewrites35.7%
if -3.99999999999999973e146 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999921e133Initial program 79.3%
Taylor expanded in a around -inf
Applied rewrites78.3%
Taylor expanded in z around inf
Applied rewrites40.2%
if 9.99999999999999921e133 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.3%
Taylor expanded in x around inf
Applied rewrites35.7%
Applied rewrites35.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (* (/ (* y x) (* z c)) 9.0)))
(if (<= t_1 -4e+146)
t_2
(if (<= t_1 1e+134) (- (* (/ (* 4.0 t) c) a)) 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 = ((y * x) / (z * c)) * 9.0;
double tmp;
if (t_1 <= -4e+146) {
tmp = t_2;
} else if (t_1 <= 1e+134) {
tmp = -(((4.0 * t) / c) * a);
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, 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 = ((y * x) / (z * c)) * 9.0d0
if (t_1 <= (-4d+146)) then
tmp = t_2
else if (t_1 <= 1d+134) then
tmp = -(((4.0d0 * t) / c) * a)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = ((y * x) / (z * c)) * 9.0;
double tmp;
if (t_1 <= -4e+146) {
tmp = t_2;
} else if (t_1 <= 1e+134) {
tmp = -(((4.0 * t) / c) * a);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y t_2 = ((y * x) / (z * c)) * 9.0 tmp = 0 if t_1 <= -4e+146: tmp = t_2 elif t_1 <= 1e+134: tmp = -(((4.0 * t) / c) * a) 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(Float64(y * x) / Float64(z * c)) * 9.0) tmp = 0.0 if (t_1 <= -4e+146) tmp = t_2; elseif (t_1 <= 1e+134) tmp = Float64(-Float64(Float64(Float64(4.0 * t) / c) * a)); 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 = ((y * x) / (z * c)) * 9.0; tmp = 0.0; if (t_1 <= -4e+146) tmp = t_2; elseif (t_1 <= 1e+134) tmp = -(((4.0 * t) / c) * a); 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[(N[(N[(y * x), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+146], t$95$2, If[LessEqual[t$95$1, 1e+134], (-N[(N[(N[(4.0 * t), $MachinePrecision] / c), $MachinePrecision] * a), $MachinePrecision]), t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := \frac{y \cdot x}{z \cdot c} \cdot 9\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+146}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+134}:\\
\;\;\;\;-\frac{4 \cdot t}{c} \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -3.99999999999999973e146 or 9.99999999999999921e133 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.3%
Taylor expanded in x around inf
Applied rewrites35.7%
Applied rewrites35.7%
if -3.99999999999999973e146 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999921e133Initial program 79.3%
Taylor expanded in a around -inf
Applied rewrites78.3%
Taylor expanded in z around inf
Applied rewrites40.2%
(FPCore (x y z t a b c) :precision binary64 (if (<= b -5.5e+104) (/ (/ b c) z) (if (<= b 7.1e+131) (- (* (/ (* 4.0 t) c) a)) (/ b (* z c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -5.5e+104) {
tmp = (b / c) / z;
} else if (b <= 7.1e+131) {
tmp = -(((4.0 * t) / c) * a);
} else {
tmp = b / (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 (b <= (-5.5d+104)) then
tmp = (b / c) / z
else if (b <= 7.1d+131) then
tmp = -(((4.0d0 * t) / c) * a)
else
tmp = b / (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 (b <= -5.5e+104) {
tmp = (b / c) / z;
} else if (b <= 7.1e+131) {
tmp = -(((4.0 * t) / c) * a);
} else {
tmp = b / (z * c);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if b <= -5.5e+104: tmp = (b / c) / z elif b <= 7.1e+131: tmp = -(((4.0 * t) / c) * a) else: tmp = b / (z * c) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -5.5e+104) tmp = Float64(Float64(b / c) / z); elseif (b <= 7.1e+131) tmp = Float64(-Float64(Float64(Float64(4.0 * t) / c) * a)); else tmp = Float64(b / Float64(z * c)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (b <= -5.5e+104) tmp = (b / c) / z; elseif (b <= 7.1e+131) tmp = -(((4.0 * t) / c) * a); else tmp = b / (z * c); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -5.5e+104], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[b, 7.1e+131], (-N[(N[(N[(4.0 * t), $MachinePrecision] / c), $MachinePrecision] * a), $MachinePrecision]), N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{+104}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;b \leq 7.1 \cdot 10^{+131}:\\
\;\;\;\;-\frac{4 \cdot t}{c} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\end{array}
\end{array}
if b < -5.50000000000000017e104Initial program 79.3%
Taylor expanded in b around inf
Applied rewrites35.0%
Applied rewrites34.6%
if -5.50000000000000017e104 < b < 7.09999999999999941e131Initial program 79.3%
Taylor expanded in a around -inf
Applied rewrites78.3%
Taylor expanded in z around inf
Applied rewrites40.2%
if 7.09999999999999941e131 < b Initial program 79.3%
Taylor expanded in b around inf
Applied rewrites35.0%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (/ (* (* a t) -4.0) c))) (if (<= z -3.9e+27) t_1 (if (<= z 1.06e-157) (/ b (* z c)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((a * t) * -4.0) / c;
double tmp;
if (z <= -3.9e+27) {
tmp = t_1;
} else if (z <= 1.06e-157) {
tmp = b / (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 = ((a * t) * (-4.0d0)) / c
if (z <= (-3.9d+27)) then
tmp = t_1
else if (z <= 1.06d-157) then
tmp = b / (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 = ((a * t) * -4.0) / c;
double tmp;
if (z <= -3.9e+27) {
tmp = t_1;
} else if (z <= 1.06e-157) {
tmp = b / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = ((a * t) * -4.0) / c tmp = 0 if z <= -3.9e+27: tmp = t_1 elif z <= 1.06e-157: tmp = b / (z * c) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(a * t) * -4.0) / c) tmp = 0.0 if (z <= -3.9e+27) tmp = t_1; elseif (z <= 1.06e-157) tmp = Float64(b / Float64(z * c)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = ((a * t) * -4.0) / c; tmp = 0.0; if (z <= -3.9e+27) tmp = t_1; elseif (z <= 1.06e-157) tmp = b / (z * c); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] * -4.0), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -3.9e+27], t$95$1, If[LessEqual[z, 1.06e-157], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(a \cdot t\right) \cdot -4}{c}\\
\mathbf{if}\;z \leq -3.9 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{-157}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.8999999999999999e27 or 1.06e-157 < z Initial program 79.3%
Taylor expanded in z around inf
Applied rewrites38.7%
if -3.8999999999999999e27 < z < 1.06e-157Initial program 79.3%
Taylor expanded in b around inf
Applied rewrites35.0%
(FPCore (x y z t a b c) :precision binary64 (if (<= b -4e+37) (/ (/ b c) z) (/ b (* z c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -4e+37) {
tmp = (b / c) / z;
} else {
tmp = b / (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 (b <= (-4d+37)) then
tmp = (b / c) / z
else
tmp = b / (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 (b <= -4e+37) {
tmp = (b / c) / z;
} else {
tmp = b / (z * c);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if b <= -4e+37: tmp = (b / c) / z else: tmp = b / (z * c) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -4e+37) tmp = Float64(Float64(b / c) / z); else tmp = Float64(b / Float64(z * c)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (b <= -4e+37) tmp = (b / c) / z; else tmp = b / (z * c); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -4e+37], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{+37}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\end{array}
\end{array}
if b < -3.99999999999999982e37Initial program 79.3%
Taylor expanded in b around inf
Applied rewrites35.0%
Applied rewrites34.6%
if -3.99999999999999982e37 < b Initial program 79.3%
Taylor expanded in b around inf
Applied rewrites35.0%
(FPCore (x y z t a b c) :precision binary64 (/ b (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return 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 = b / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
def code(x, y, z, t, a, b, c): return b / (z * c)
function code(x, y, z, t, a, b, c) return Float64(b / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = b / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{b}{z \cdot c}
\end{array}
Initial program 79.3%
Taylor expanded in b around inf
Applied rewrites35.0%
herbie shell --seed 2025141
(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)))