
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y)))
(fma
a
(/ (+ t y) (+ (+ t x) y))
(fma z (/ (+ x y) t_1) (- (* b (/ y t_1)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
return fma(a, ((t + y) / ((t + x) + y)), fma(z, ((x + y) / t_1), -(b * (y / t_1))));
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) return fma(a, Float64(Float64(t + y) / Float64(Float64(t + x) + y)), fma(z, Float64(Float64(x + y) / t_1), Float64(-Float64(b * Float64(y / t_1))))) end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, N[(a * N[(N[(t + y), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision] + (-N[(b * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
\mathsf{fma}\left(a, \frac{t + y}{\left(t + x\right) + y}, \mathsf{fma}\left(z, \frac{x + y}{t\_1}, -b \cdot \frac{y}{t\_1}\right)\right)
\end{array}
Initial program 60.4%
lift-/.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
div-addN/A
sub-flip-reverseN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites71.7%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-flipN/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6498.5%
Applied rewrites98.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) t_1))
(t_3 (fma a 1.0 (fma z (/ (+ x y) t_1) (- (* b (/ y t_1)))))))
(if (<= t_2 -2e+276)
t_3
(if (<= t_2 4e+178)
(/ (fma a t (fma x z (* y (- (+ a z) b)))) t_1)
t_3))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / t_1;
double t_3 = fma(a, 1.0, fma(z, ((x + y) / t_1), -(b * (y / t_1))));
double tmp;
if (t_2 <= -2e+276) {
tmp = t_3;
} else if (t_2 <= 4e+178) {
tmp = fma(a, t, fma(x, z, (y * ((a + z) - b)))) / t_1;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1) t_3 = fma(a, 1.0, fma(z, Float64(Float64(x + y) / t_1), Float64(-Float64(b * Float64(y / t_1))))) tmp = 0.0 if (t_2 <= -2e+276) tmp = t_3; elseif (t_2 <= 4e+178) tmp = Float64(fma(a, t, fma(x, z, Float64(y * Float64(Float64(a + z) - b)))) / t_1); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(a * 1.0 + N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision] + (-N[(b * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+276], t$95$3, If[LessEqual[t$95$2, 4e+178], N[(N[(a * t + N[(x * z + N[(y * N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
t_3 := \mathsf{fma}\left(a, 1, \mathsf{fma}\left(z, \frac{x + y}{t\_1}, -b \cdot \frac{y}{t\_1}\right)\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+276}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+178}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, \mathsf{fma}\left(x, z, y \cdot \left(\left(a + z\right) - b\right)\right)\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2.0000000000000001e276 or 4.0000000000000002e178 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.4%
lift-/.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
div-addN/A
sub-flip-reverseN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites71.7%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-flipN/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6498.5%
Applied rewrites98.5%
Taylor expanded in x around 0
Applied rewrites84.5%
if -2.0000000000000001e276 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.0000000000000002e178Initial program 60.4%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6460.7%
Applied rewrites60.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) t_1))
(t_3 (- (fma (/ (+ x y) t_1) z (* 1.0 a)) (* y (/ b t_1)))))
(if (<= t_2 -2e+276)
t_3
(if (<= t_2 1e+211)
(/ (fma a t (fma x z (* y (- (+ a z) b)))) t_1)
t_3))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / t_1;
double t_3 = fma(((x + y) / t_1), z, (1.0 * a)) - (y * (b / t_1));
double tmp;
if (t_2 <= -2e+276) {
tmp = t_3;
} else if (t_2 <= 1e+211) {
tmp = fma(a, t, fma(x, z, (y * ((a + z) - b)))) / t_1;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1) t_3 = Float64(fma(Float64(Float64(x + y) / t_1), z, Float64(1.0 * a)) - Float64(y * Float64(b / t_1))) tmp = 0.0 if (t_2 <= -2e+276) tmp = t_3; elseif (t_2 <= 1e+211) tmp = Float64(fma(a, t, fma(x, z, Float64(y * Float64(Float64(a + z) - b)))) / t_1); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision] * z + N[(1.0 * a), $MachinePrecision]), $MachinePrecision] - N[(y * N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+276], t$95$3, If[LessEqual[t$95$2, 1e+211], N[(N[(a * t + N[(x * z + N[(y * N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
t_3 := \mathsf{fma}\left(\frac{x + y}{t\_1}, z, 1 \cdot a\right) - y \cdot \frac{b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+276}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{+211}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, \mathsf{fma}\left(x, z, y \cdot \left(\left(a + z\right) - b\right)\right)\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2.0000000000000001e276 or 9.9999999999999996e210 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.4%
lift-/.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
div-addN/A
sub-flip-reverseN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites71.7%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-flipN/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6498.5%
Applied rewrites98.5%
Taylor expanded in x around 0
Applied rewrites84.5%
lift-fma.f64N/A
lift-fma.f64N/A
associate-+r+N/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f64N/A
Applied rewrites82.9%
if -2.0000000000000001e276 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.9999999999999996e210Initial program 60.4%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6460.7%
Applied rewrites60.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) t_1)))
(if (<= t_2 (- INFINITY))
(fma a 1.0 (fma z (/ y (+ t y)) (- (* b (/ y t_1)))))
(if (<= t_2 5e+234)
(/ (fma a t (fma x z (* y (- (+ a z) b)))) t_1)
(fma a (/ (+ t y) (+ (+ t x) y)) (- z b))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = fma(a, 1.0, fma(z, (y / (t + y)), -(b * (y / t_1))));
} else if (t_2 <= 5e+234) {
tmp = fma(a, t, fma(x, z, (y * ((a + z) - b)))) / t_1;
} else {
tmp = fma(a, ((t + y) / ((t + x) + y)), (z - b));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = fma(a, 1.0, fma(z, Float64(y / Float64(t + y)), Float64(-Float64(b * Float64(y / t_1))))); elseif (t_2 <= 5e+234) tmp = Float64(fma(a, t, fma(x, z, Float64(y * Float64(Float64(a + z) - b)))) / t_1); else tmp = fma(a, Float64(Float64(t + y) / Float64(Float64(t + x) + y)), Float64(z - b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(a * 1.0 + N[(z * N[(y / N[(t + y), $MachinePrecision]), $MachinePrecision] + (-N[(b * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+234], N[(N[(a * t + N[(x * z + N[(y * N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(a * N[(N[(t + y), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(a, 1, \mathsf{fma}\left(z, \frac{y}{t + y}, -b \cdot \frac{y}{t\_1}\right)\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+234}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, \mathsf{fma}\left(x, z, y \cdot \left(\left(a + z\right) - b\right)\right)\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t + y}{\left(t + x\right) + y}, z - b\right)\\
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0Initial program 60.4%
lift-/.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
div-addN/A
sub-flip-reverseN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites71.7%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-flipN/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6498.5%
Applied rewrites98.5%
Taylor expanded in x around 0
Applied rewrites84.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6472.6%
Applied rewrites72.6%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000003e234Initial program 60.4%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6460.7%
Applied rewrites60.7%
if 5.0000000000000003e234 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.4%
lift-/.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
div-addN/A
sub-flip-reverseN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites71.7%
Taylor expanded in y around inf
lower--.f6464.1%
Applied rewrites64.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) t_1))
(t_3 (fma a (/ (+ t y) (+ (+ t x) y)) (- z b))))
(if (<= t_2 -2e+276)
t_3
(if (<= t_2 5e+234)
(/ (fma a t (fma x z (* y (- (+ a z) b)))) t_1)
t_3))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / t_1;
double t_3 = fma(a, ((t + y) / ((t + x) + y)), (z - b));
double tmp;
if (t_2 <= -2e+276) {
tmp = t_3;
} else if (t_2 <= 5e+234) {
tmp = fma(a, t, fma(x, z, (y * ((a + z) - b)))) / t_1;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1) t_3 = fma(a, Float64(Float64(t + y) / Float64(Float64(t + x) + y)), Float64(z - b)) tmp = 0.0 if (t_2 <= -2e+276) tmp = t_3; elseif (t_2 <= 5e+234) tmp = Float64(fma(a, t, fma(x, z, Float64(y * Float64(Float64(a + z) - b)))) / t_1); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(a * N[(N[(t + y), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+276], t$95$3, If[LessEqual[t$95$2, 5e+234], N[(N[(a * t + N[(x * z + N[(y * N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
t_3 := \mathsf{fma}\left(a, \frac{t + y}{\left(t + x\right) + y}, z - b\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+276}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+234}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, \mathsf{fma}\left(x, z, y \cdot \left(\left(a + z\right) - b\right)\right)\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2.0000000000000001e276 or 5.0000000000000003e234 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.4%
lift-/.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
div-addN/A
sub-flip-reverseN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites71.7%
Taylor expanded in y around inf
lower--.f6464.1%
Applied rewrites64.1%
if -2.0000000000000001e276 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000003e234Initial program 60.4%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6460.7%
Applied rewrites60.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma a (/ (+ t y) (+ (+ t x) y)) (- z b))))
(if (<= y -7.2e-79)
t_1
(if (<= y 7.2e-115) (fma x (/ z (+ x t)) (* t (/ a (+ x t)))) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(a, ((t + y) / ((t + x) + y)), (z - b));
double tmp;
if (y <= -7.2e-79) {
tmp = t_1;
} else if (y <= 7.2e-115) {
tmp = fma(x, (z / (x + t)), (t * (a / (x + t))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(a, Float64(Float64(t + y) / Float64(Float64(t + x) + y)), Float64(z - b)) tmp = 0.0 if (y <= -7.2e-79) tmp = t_1; elseif (y <= 7.2e-115) tmp = fma(x, Float64(z / Float64(x + t)), Float64(t * Float64(a / Float64(x + t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(N[(t + y), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.2e-79], t$95$1, If[LessEqual[y, 7.2e-115], N[(x * N[(z / N[(x + t), $MachinePrecision]), $MachinePrecision] + N[(t * N[(a / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, \frac{t + y}{\left(t + x\right) + y}, z - b\right)\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{-79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-115}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{z}{x + t}, t \cdot \frac{a}{x + t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -7.2000000000000005e-79 or 7.2000000000000002e-115 < y Initial program 60.4%
lift-/.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
div-addN/A
sub-flip-reverseN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites71.7%
Taylor expanded in y around inf
lower--.f6464.1%
Applied rewrites64.1%
if -7.2000000000000005e-79 < y < 7.2000000000000002e-115Initial program 60.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6440.6%
Applied rewrites40.6%
lift-/.f64N/A
lift-fma.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6452.0%
lift-+.f64N/A
+-commutativeN/A
lift-+.f6452.0%
Applied rewrites52.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma a (/ (+ t y) (+ (+ t x) y)) (- z b))))
(if (<= y -800000000.0)
t_1
(if (<= y -2.5e-205)
(fma a 1.0 (- z (/ (* b y) (+ x y))))
(if (<= y 1.7e-176) (/ (fma a t (* x z)) (+ t x)) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(a, ((t + y) / ((t + x) + y)), (z - b));
double tmp;
if (y <= -800000000.0) {
tmp = t_1;
} else if (y <= -2.5e-205) {
tmp = fma(a, 1.0, (z - ((b * y) / (x + y))));
} else if (y <= 1.7e-176) {
tmp = fma(a, t, (x * z)) / (t + x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(a, Float64(Float64(t + y) / Float64(Float64(t + x) + y)), Float64(z - b)) tmp = 0.0 if (y <= -800000000.0) tmp = t_1; elseif (y <= -2.5e-205) tmp = fma(a, 1.0, Float64(z - Float64(Float64(b * y) / Float64(x + y)))); elseif (y <= 1.7e-176) tmp = Float64(fma(a, t, Float64(x * z)) / Float64(t + x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(N[(t + y), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -800000000.0], t$95$1, If[LessEqual[y, -2.5e-205], N[(a * 1.0 + N[(z - N[(N[(b * y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-176], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, \frac{t + y}{\left(t + x\right) + y}, z - b\right)\\
\mathbf{if}\;y \leq -800000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-205}:\\
\;\;\;\;\mathsf{fma}\left(a, 1, z - \frac{b \cdot y}{x + y}\right)\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-176}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -8e8 or 1.6999999999999999e-176 < y Initial program 60.4%
lift-/.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
div-addN/A
sub-flip-reverseN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites71.7%
Taylor expanded in y around inf
lower--.f6464.1%
Applied rewrites64.1%
if -8e8 < y < -2.5e-205Initial program 60.4%
lift-/.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
div-addN/A
sub-flip-reverseN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites71.7%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-flipN/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6498.5%
Applied rewrites98.5%
Taylor expanded in x around 0
Applied rewrites84.5%
Taylor expanded in t around 0
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6454.4%
Applied rewrites54.4%
if -2.5e-205 < y < 1.6999999999999999e-176Initial program 60.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6440.6%
Applied rewrites40.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) t_1))
(t_3 (fma a (/ (+ t y) (+ (+ t x) y)) (- z b))))
(if (<= t_2 -1e+21)
t_3
(if (<= t_2 5e+85) (/ (- (* z (+ x y)) (* b y)) t_1) t_3))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / t_1;
double t_3 = fma(a, ((t + y) / ((t + x) + y)), (z - b));
double tmp;
if (t_2 <= -1e+21) {
tmp = t_3;
} else if (t_2 <= 5e+85) {
tmp = ((z * (x + y)) - (b * y)) / t_1;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1) t_3 = fma(a, Float64(Float64(t + y) / Float64(Float64(t + x) + y)), Float64(z - b)) tmp = 0.0 if (t_2 <= -1e+21) tmp = t_3; elseif (t_2 <= 5e+85) tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(b * y)) / t_1); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(a * N[(N[(t + y), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+21], t$95$3, If[LessEqual[t$95$2, 5e+85], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
t_3 := \mathsf{fma}\left(a, \frac{t + y}{\left(t + x\right) + y}, z - b\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+21}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+85}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - b \cdot y}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -1e21 or 5.0000000000000001e85 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.4%
lift-/.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
div-addN/A
sub-flip-reverseN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites71.7%
Taylor expanded in y around inf
lower--.f6464.1%
Applied rewrites64.1%
if -1e21 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000001e85Initial program 60.4%
Taylor expanded in a around 0
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6438.0%
Applied rewrites38.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (- a b))))
(if (<= y -2.6e+31)
t_1
(if (<= y -2.5e-205)
(fma a 1.0 (- z (/ (* b y) (+ x y))))
(if (<= y 1.7e-176) (/ (fma a t (* x z)) (+ t x)) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + (a - b);
double tmp;
if (y <= -2.6e+31) {
tmp = t_1;
} else if (y <= -2.5e-205) {
tmp = fma(a, 1.0, (z - ((b * y) / (x + y))));
} else if (y <= 1.7e-176) {
tmp = fma(a, t, (x * z)) / (t + x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(a - b)) tmp = 0.0 if (y <= -2.6e+31) tmp = t_1; elseif (y <= -2.5e-205) tmp = fma(a, 1.0, Float64(z - Float64(Float64(b * y) / Float64(x + y)))); elseif (y <= 1.7e-176) tmp = Float64(fma(a, t, Float64(x * z)) / Float64(t + x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(a - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.6e+31], t$95$1, If[LessEqual[y, -2.5e-205], N[(a * 1.0 + N[(z - N[(N[(b * y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-176], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := z + \left(a - b\right)\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-205}:\\
\;\;\;\;\mathsf{fma}\left(a, 1, z - \frac{b \cdot y}{x + y}\right)\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-176}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -2.6e31 or 1.6999999999999999e-176 < y Initial program 60.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.0%
Applied rewrites56.0%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
lower--.f6456.0%
Applied rewrites56.0%
if -2.6e31 < y < -2.5e-205Initial program 60.4%
lift-/.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
div-addN/A
sub-flip-reverseN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites71.7%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-flipN/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6498.5%
Applied rewrites98.5%
Taylor expanded in x around 0
Applied rewrites84.5%
Taylor expanded in t around 0
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6454.4%
Applied rewrites54.4%
if -2.5e-205 < y < 1.6999999999999999e-176Initial program 60.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6440.6%
Applied rewrites40.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (- a b))))
(if (<= y -8e-178)
t_1
(if (<= y 1.7e-176) (/ (fma a t (* x z)) (+ t x)) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + (a - b);
double tmp;
if (y <= -8e-178) {
tmp = t_1;
} else if (y <= 1.7e-176) {
tmp = fma(a, t, (x * z)) / (t + x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(a - b)) tmp = 0.0 if (y <= -8e-178) tmp = t_1; elseif (y <= 1.7e-176) tmp = Float64(fma(a, t, Float64(x * z)) / Float64(t + x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(a - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8e-178], t$95$1, If[LessEqual[y, 1.7e-176], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := z + \left(a - b\right)\\
\mathbf{if}\;y \leq -8 \cdot 10^{-178}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-176}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -7.9999999999999996e-178 or 1.6999999999999999e-176 < y Initial program 60.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.0%
Applied rewrites56.0%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
lower--.f6456.0%
Applied rewrites56.0%
if -7.9999999999999996e-178 < y < 1.6999999999999999e-176Initial program 60.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6440.6%
Applied rewrites40.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x 3.8e+68) (+ z (- a b)) (+ z (* t (- (/ a x) (/ z x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 3.8e+68) {
tmp = z + (a - b);
} else {
tmp = z + (t * ((a / x) - (z / x)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= 3.8d+68) then
tmp = z + (a - b)
else
tmp = z + (t * ((a / x) - (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 3.8e+68) {
tmp = z + (a - b);
} else {
tmp = z + (t * ((a / x) - (z / x)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 3.8e+68: tmp = z + (a - b) else: tmp = z + (t * ((a / x) - (z / x))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 3.8e+68) tmp = Float64(z + Float64(a - b)); else tmp = Float64(z + Float64(t * Float64(Float64(a / x) - Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 3.8e+68) tmp = z + (a - b); else tmp = z + (t * ((a / x) - (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 3.8e+68], N[(z + N[(a - b), $MachinePrecision]), $MachinePrecision], N[(z + N[(t * N[(N[(a / x), $MachinePrecision] - N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 3.8 \cdot 10^{+68}:\\
\;\;\;\;z + \left(a - b\right)\\
\mathbf{else}:\\
\;\;\;\;z + t \cdot \left(\frac{a}{x} - \frac{z}{x}\right)\\
\end{array}
if x < 3.8000000000000001e68Initial program 60.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.0%
Applied rewrites56.0%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
lower--.f6456.0%
Applied rewrites56.0%
if 3.8000000000000001e68 < x Initial program 60.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6440.6%
Applied rewrites40.6%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6430.0%
Applied rewrites30.0%
(FPCore (x y z t a b) :precision binary64 (if (<= x 7.5e+96) (+ z (- a b)) (* (/ (+ x y) (+ (+ x t) y)) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 7.5e+96) {
tmp = z + (a - b);
} else {
tmp = ((x + y) / ((x + t) + y)) * 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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= 7.5d+96) then
tmp = z + (a - b)
else
tmp = ((x + y) / ((x + t) + y)) * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 7.5e+96) {
tmp = z + (a - b);
} else {
tmp = ((x + y) / ((x + t) + y)) * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 7.5e+96: tmp = z + (a - b) else: tmp = ((x + y) / ((x + t) + y)) * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 7.5e+96) tmp = Float64(z + Float64(a - b)); else tmp = Float64(Float64(Float64(x + y) / Float64(Float64(x + t) + y)) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 7.5e+96) tmp = z + (a - b); else tmp = ((x + y) / ((x + t) + y)) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 7.5e+96], N[(z + N[(a - b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + y), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 7.5 \cdot 10^{+96}:\\
\;\;\;\;z + \left(a - b\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y}{\left(x + t\right) + y} \cdot z\\
\end{array}
if x < 7.4999999999999996e96Initial program 60.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.0%
Applied rewrites56.0%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
lower--.f6456.0%
Applied rewrites56.0%
if 7.4999999999999996e96 < x Initial program 60.4%
lift-/.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
div-addN/A
sub-flip-reverseN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites71.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-+.f6440.3%
Applied rewrites40.3%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
div-add-revN/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lower-*.f6440.3%
Applied rewrites40.3%
(FPCore (x y z t a b) :precision binary64 (if (<= x 7.5e+96) (+ z (- a b)) z))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 7.5e+96) {
tmp = z + (a - b);
} else {
tmp = 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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= 7.5d+96) then
tmp = z + (a - b)
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 7.5e+96) {
tmp = z + (a - b);
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 7.5e+96: tmp = z + (a - b) else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 7.5e+96) tmp = Float64(z + Float64(a - b)); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 7.5e+96) tmp = z + (a - b); else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 7.5e+96], N[(z + N[(a - b), $MachinePrecision]), $MachinePrecision], z]
\begin{array}{l}
\mathbf{if}\;x \leq 7.5 \cdot 10^{+96}:\\
\;\;\;\;z + \left(a - b\right)\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
if x < 7.4999999999999996e96Initial program 60.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.0%
Applied rewrites56.0%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
lower--.f6456.0%
Applied rewrites56.0%
if 7.4999999999999996e96 < x Initial program 60.4%
Taylor expanded in x around inf
Applied rewrites32.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -5.4e-110) z (if (<= x 3.1e+65) (- a b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5.4e-110) {
tmp = z;
} else if (x <= 3.1e+65) {
tmp = a - b;
} else {
tmp = 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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-5.4d-110)) then
tmp = z
else if (x <= 3.1d+65) then
tmp = a - b
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5.4e-110) {
tmp = z;
} else if (x <= 3.1e+65) {
tmp = a - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -5.4e-110: tmp = z elif x <= 3.1e+65: tmp = a - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -5.4e-110) tmp = z; elseif (x <= 3.1e+65) tmp = Float64(a - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -5.4e-110) tmp = z; elseif (x <= 3.1e+65) tmp = a - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -5.4e-110], z, If[LessEqual[x, 3.1e+65], N[(a - b), $MachinePrecision], z]]
\begin{array}{l}
\mathbf{if}\;x \leq -5.4 \cdot 10^{-110}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+65}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
if x < -5.3999999999999996e-110 or 3.0999999999999999e65 < x Initial program 60.4%
Taylor expanded in x around inf
Applied rewrites32.9%
if -5.3999999999999996e-110 < x < 3.0999999999999999e65Initial program 60.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.0%
Applied rewrites56.0%
Taylor expanded in z around 0
Applied rewrites37.4%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.25e+90) a (if (<= a 1.02e-38) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.25e+90) {
tmp = a;
} else if (a <= 1.02e-38) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1.25d+90)) then
tmp = a
else if (a <= 1.02d-38) then
tmp = z
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.25e+90) {
tmp = a;
} else if (a <= 1.02e-38) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.25e+90: tmp = a elif a <= 1.02e-38: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.25e+90) tmp = a; elseif (a <= 1.02e-38) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.25e+90) tmp = a; elseif (a <= 1.02e-38) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.25e+90], a, If[LessEqual[a, 1.02e-38], z, a]]
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{+90}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 1.02 \cdot 10^{-38}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
if a < -1.2500000000000001e90 or 1.02e-38 < a Initial program 60.4%
Taylor expanded in t around inf
Applied rewrites32.2%
if -1.2500000000000001e90 < a < 1.02e-38Initial program 60.4%
Taylor expanded in x around inf
Applied rewrites32.9%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
a
Initial program 60.4%
Taylor expanded in t around inf
Applied rewrites32.2%
herbie shell --seed 2025205
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
(/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))