
(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 15 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 (+ (+ t x) y))
(t_2
(/
(- (+ (* (+ x y) z) (* (+ t y) a)) (* y b))
(+ (+ x t) y))))
(if (<= t_2 (- INFINITY))
(- (+ a z) (* b (/ y (+ x y))))
(if (<= t_2 5e+289)
(fma z (/ (+ y x) t_1) (/ (- (* a (+ t y)) (* b y)) t_1))
(fma (/ a (+ y x)) y (- z (* (/ y (+ y x)) b)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (a + z) - (b * (y / (x + y)));
} else if (t_2 <= 5e+289) {
tmp = fma(z, ((y + x) / t_1), (((a * (t + y)) - (b * y)) / t_1));
} else {
tmp = fma((a / (y + x)), y, (z - ((y / (y + x)) * b)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(a + z) - Float64(b * Float64(y / Float64(x + y)))); elseif (t_2 <= 5e+289) tmp = fma(z, Float64(Float64(y + x) / t_1), Float64(Float64(Float64(a * Float64(t + y)) - Float64(b * y)) / t_1)); else tmp = fma(Float64(a / Float64(y + x)), y, Float64(z - Float64(Float64(y / Float64(y + x)) * b))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $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] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(a + z), $MachinePrecision] - N[(b * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+289], N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(N[(a * N[(t + y), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(a / N[(y + x), $MachinePrecision]), $MachinePrecision] * y + N[(z - N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\left(a + z\right) - b \cdot \frac{y}{x + y}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+289}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y + x}{t\_1}, \frac{a \cdot \left(t + y\right) - b \cdot y}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{y + x}, y, z - \frac{y}{y + x} \cdot 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 61.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6440.1%
Applied rewrites40.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6456.7%
Applied rewrites56.7%
Taylor expanded in x around 0
lower-+.f6463.6%
Applied rewrites63.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.0000000000000003e289Initial program 61.8%
lift-/.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites73.6%
if 5.0000000000000003e289 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 61.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6440.1%
Applied rewrites40.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6456.7%
Applied rewrites56.7%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6465.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6465.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6465.1%
Applied rewrites65.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)))
(if (<= t_2 (- INFINITY))
(- (+ a z) (* b (/ y (+ x y))))
(if (<= t_2 5e+289)
(/ (fma a t (fma x z (* y (- (+ a z) b)))) t_1)
(fma (/ a (+ y x)) y (- z (* (/ y (+ y x)) 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 = (a + z) - (b * (y / (x + y)));
} else if (t_2 <= 5e+289) {
tmp = fma(a, t, fma(x, z, (y * ((a + z) - b)))) / t_1;
} else {
tmp = fma((a / (y + x)), y, (z - ((y / (y + x)) * 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 = Float64(Float64(a + z) - Float64(b * Float64(y / Float64(x + y)))); elseif (t_2 <= 5e+289) tmp = Float64(fma(a, t, fma(x, z, Float64(y * Float64(Float64(a + z) - b)))) / t_1); else tmp = fma(Float64(a / Float64(y + x)), y, Float64(z - Float64(Float64(y / Float64(y + x)) * 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[(N[(a + z), $MachinePrecision] - N[(b * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+289], N[(N[(a * t + N[(x * z + N[(y * N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(a / N[(y + x), $MachinePrecision]), $MachinePrecision] * y + N[(z - N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $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:\\
\;\;\;\;\left(a + z\right) - b \cdot \frac{y}{x + y}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+289}:\\
\;\;\;\;\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(\frac{a}{y + x}, y, z - \frac{y}{y + x} \cdot 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 61.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6440.1%
Applied rewrites40.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6456.7%
Applied rewrites56.7%
Taylor expanded in x around 0
lower-+.f6463.6%
Applied rewrites63.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.0000000000000003e289Initial program 61.8%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6462.0%
Applied rewrites62.0%
if 5.0000000000000003e289 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 61.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6440.1%
Applied rewrites40.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6456.7%
Applied rewrites56.7%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6465.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6465.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6465.1%
Applied rewrites65.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(/
(- (+ (* (+ x y) z) (* (+ t y) a)) (* y b))
(+ (+ x t) y))))
(if (<= t_1 -2e+185)
(- (+ a z) (* b (/ y (+ x y))))
(if (<= t_1 5e+289)
(/ (fma a (+ t y) (* z (+ x y))) (+ t (+ x y)))
(fma (/ a (+ y x)) y (- z (* (/ y (+ y x)) b)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
double tmp;
if (t_1 <= -2e+185) {
tmp = (a + z) - (b * (y / (x + y)));
} else if (t_1 <= 5e+289) {
tmp = fma(a, (t + y), (z * (x + y))) / (t + (x + y));
} else {
tmp = fma((a / (y + x)), y, (z - ((y / (y + x)) * b)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) tmp = 0.0 if (t_1 <= -2e+185) tmp = Float64(Float64(a + z) - Float64(b * Float64(y / Float64(x + y)))); elseif (t_1 <= 5e+289) tmp = Float64(fma(a, Float64(t + y), Float64(z * Float64(x + y))) / Float64(t + Float64(x + y))); else tmp = fma(Float64(a / Float64(y + x)), y, Float64(z - Float64(Float64(y / Float64(y + x)) * b))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -2e+185], N[(N[(a + z), $MachinePrecision] - N[(b * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+289], N[(N[(a * N[(t + y), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a / N[(y + x), $MachinePrecision]), $MachinePrecision] * y + N[(z - N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+185}:\\
\;\;\;\;\left(a + z\right) - b \cdot \frac{y}{x + y}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+289}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t + y, z \cdot \left(x + y\right)\right)}{t + \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{y + x}, y, z - \frac{y}{y + x} \cdot 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)) < -2e185Initial program 61.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6440.1%
Applied rewrites40.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6456.7%
Applied rewrites56.7%
Taylor expanded in x around 0
lower-+.f6463.6%
Applied rewrites63.6%
if -2e185 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000003e289Initial program 61.8%
Taylor expanded in b around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6448.7%
Applied rewrites48.7%
if 5.0000000000000003e289 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 61.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6440.1%
Applied rewrites40.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6456.7%
Applied rewrites56.7%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6465.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6465.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6465.1%
Applied rewrites65.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
(t_2 (- (+ a z) (* b (/ y (+ x y))))))
(if (<= t_1 -2e+185)
t_2
(if (<= t_1 1e+187)
(/ (fma a (+ t y) (* z (+ x y))) (+ t (+ x y)))
t_2))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
double t_2 = (a + z) - (b * (y / (x + y)));
double tmp;
if (t_1 <= -2e+185) {
tmp = t_2;
} else if (t_1 <= 1e+187) {
tmp = fma(a, (t + y), (z * (x + y))) / (t + (x + y));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) t_2 = Float64(Float64(a + z) - Float64(b * Float64(y / Float64(x + y)))) tmp = 0.0 if (t_1 <= -2e+185) tmp = t_2; elseif (t_1 <= 1e+187) tmp = Float64(fma(a, Float64(t + y), Float64(z * Float64(x + y))) / Float64(t + Float64(x + y))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - N[(b * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+185], t$95$2, If[LessEqual[t$95$1, 1e+187], N[(N[(a * N[(t + y), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
t_2 := \left(a + z\right) - b \cdot \frac{y}{x + y}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+185}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+187}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t + y, z \cdot \left(x + y\right)\right)}{t + \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2e185 or 9.9999999999999991e186 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 61.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6440.1%
Applied rewrites40.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6456.7%
Applied rewrites56.7%
Taylor expanded in x around 0
lower-+.f6463.6%
Applied rewrites63.6%
if -2e185 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.9999999999999991e186Initial program 61.8%
Taylor expanded in b around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6448.7%
Applied rewrites48.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.2e+92)
(fma (/ a (+ y x)) y (- z b))
(if (<= y 2.25e-93)
(fma a (/ (+ t y) (+ (+ t x) y)) z)
(if (<= y 2.5e+43)
(/ (- (* z (+ x y)) (* b y)) (+ (+ x t) y))
(- (+ a z) (* b (/ y (+ x y))))))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.2e+92) {
tmp = fma((a / (y + x)), y, (z - b));
} else if (y <= 2.25e-93) {
tmp = fma(a, ((t + y) / ((t + x) + y)), z);
} else if (y <= 2.5e+43) {
tmp = ((z * (x + y)) - (b * y)) / ((x + t) + y);
} else {
tmp = (a + z) - (b * (y / (x + y)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.2e+92) tmp = fma(Float64(a / Float64(y + x)), y, Float64(z - b)); elseif (y <= 2.25e-93) tmp = fma(a, Float64(Float64(t + y) / Float64(Float64(t + x) + y)), z); elseif (y <= 2.5e+43) tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(b * y)) / Float64(Float64(x + t) + y)); else tmp = Float64(Float64(a + z) - Float64(b * Float64(y / Float64(x + y)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.2e+92], N[(N[(a / N[(y + x), $MachinePrecision]), $MachinePrecision] * y + N[(z - b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.25e-93], N[(a * N[(N[(t + y), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[y, 2.5e+43], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - N[(b * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+92}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{y + x}, y, z - b\right)\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{-93}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t + y}{\left(t + x\right) + y}, z\right)\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+43}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - b \cdot y}{\left(x + t\right) + y}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b \cdot \frac{y}{x + y}\\
\end{array}
if y < -2.1999999999999999e92Initial program 61.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6440.1%
Applied rewrites40.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6456.7%
Applied rewrites56.7%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6465.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6465.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6465.1%
Applied rewrites65.1%
Taylor expanded in x around 0
Applied rewrites53.4%
if -2.1999999999999999e92 < y < 2.2500000000000001e-93Initial program 61.8%
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 rewrites73.3%
Taylor expanded in x around inf
Applied rewrites65.2%
if 2.2500000000000001e-93 < y < 2.5000000000000002e43Initial program 61.8%
Taylor expanded in a around 0
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if 2.5000000000000002e43 < y Initial program 61.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6440.1%
Applied rewrites40.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6456.7%
Applied rewrites56.7%
Taylor expanded in x around 0
lower-+.f6463.6%
Applied rewrites63.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma a (/ (+ t y) (+ (+ t x) y)) z)))
(if (<= a -5.3e+16)
t_1
(if (<= a 1.5e-58) (- z (* b (/ y (+ (+ x t) y)))) 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);
double tmp;
if (a <= -5.3e+16) {
tmp = t_1;
} else if (a <= 1.5e-58) {
tmp = z - (b * (y / ((x + t) + y)));
} 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)), z) tmp = 0.0 if (a <= -5.3e+16) tmp = t_1; elseif (a <= 1.5e-58) tmp = Float64(z - Float64(b * Float64(y / Float64(Float64(x + t) + y)))); 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] + z), $MachinePrecision]}, If[LessEqual[a, -5.3e+16], t$95$1, If[LessEqual[a, 1.5e-58], N[(z - N[(b * N[(y / N[(N[(x + t), $MachinePrecision] + y), $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\right)\\
\mathbf{if}\;a \leq -5.3 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{-58}:\\
\;\;\;\;z - b \cdot \frac{y}{\left(x + t\right) + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -5.3e16 or 1.5e-58 < a Initial program 61.8%
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 rewrites73.3%
Taylor expanded in x around inf
Applied rewrites65.2%
if -5.3e16 < a < 1.5e-58Initial program 61.8%
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 rewrites73.3%
Applied rewrites65.9%
Taylor expanded in x around inf
Applied rewrites52.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -8.6e+82)
(- z (* b (/ y (+ (+ x t) y))))
(if (<= x 4.5e+199)
(- (+ a z) (* b (/ y (+ x y))))
(fma (/ (- a b) x) y z))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8.6e+82) {
tmp = z - (b * (y / ((x + t) + y)));
} else if (x <= 4.5e+199) {
tmp = (a + z) - (b * (y / (x + y)));
} else {
tmp = fma(((a - b) / x), y, z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -8.6e+82) tmp = Float64(z - Float64(b * Float64(y / Float64(Float64(x + t) + y)))); elseif (x <= 4.5e+199) tmp = Float64(Float64(a + z) - Float64(b * Float64(y / Float64(x + y)))); else tmp = fma(Float64(Float64(a - b) / x), y, z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -8.6e+82], N[(z - N[(b * N[(y / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.5e+199], N[(N[(a + z), $MachinePrecision] - N[(b * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a - b), $MachinePrecision] / x), $MachinePrecision] * y + z), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \leq -8.6 \cdot 10^{+82}:\\
\;\;\;\;z - b \cdot \frac{y}{\left(x + t\right) + y}\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+199}:\\
\;\;\;\;\left(a + z\right) - b \cdot \frac{y}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a - b}{x}, y, z\right)\\
\end{array}
if x < -8.6000000000000003e82Initial program 61.8%
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 rewrites73.3%
Applied rewrites65.9%
Taylor expanded in x around inf
Applied rewrites52.0%
if -8.6000000000000003e82 < x < 4.4999999999999997e199Initial program 61.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6440.1%
Applied rewrites40.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6456.7%
Applied rewrites56.7%
Taylor expanded in x around 0
lower-+.f6463.6%
Applied rewrites63.6%
if 4.4999999999999997e199 < x Initial program 61.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6440.1%
Applied rewrites40.1%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6434.0%
Applied rewrites34.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6434.0%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6434.1%
Applied rewrites34.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
(t_2 (- (+ a z) (* b (/ y (+ x y))))))
(if (<= t_1 -2e+58)
t_2
(if (<= t_1 1e+140) (/ (fma a t (* x z)) (+ t x)) t_2))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
double t_2 = (a + z) - (b * (y / (x + y)));
double tmp;
if (t_1 <= -2e+58) {
tmp = t_2;
} else if (t_1 <= 1e+140) {
tmp = fma(a, t, (x * z)) / (t + x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) t_2 = Float64(Float64(a + z) - Float64(b * Float64(y / Float64(x + y)))) tmp = 0.0 if (t_1 <= -2e+58) tmp = t_2; elseif (t_1 <= 1e+140) tmp = Float64(fma(a, t, Float64(x * z)) / Float64(t + x)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - N[(b * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+58], t$95$2, If[LessEqual[t$95$1, 1e+140], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
t_2 := \left(a + z\right) - b \cdot \frac{y}{x + y}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+58}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+140}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -1.9999999999999999e58 or 1.0000000000000001e140 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 61.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6440.1%
Applied rewrites40.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6456.7%
Applied rewrites56.7%
Taylor expanded in x around 0
lower-+.f6463.6%
Applied rewrites63.6%
if -1.9999999999999999e58 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.0000000000000001e140Initial program 61.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6442.0%
Applied rewrites42.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.2e-59)
(fma (/ a (+ y x)) y (- z b))
(if (<= y 1.08e-193)
(/ (fma a t (* x z)) (+ t x))
(if (<= y 4.2e+48) (- z (/ (* b y) (+ x y))) (- (+ a z) b)))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.2e-59) {
tmp = fma((a / (y + x)), y, (z - b));
} else if (y <= 1.08e-193) {
tmp = fma(a, t, (x * z)) / (t + x);
} else if (y <= 4.2e+48) {
tmp = z - ((b * y) / (x + y));
} else {
tmp = (a + z) - b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.2e-59) tmp = fma(Float64(a / Float64(y + x)), y, Float64(z - b)); elseif (y <= 1.08e-193) tmp = Float64(fma(a, t, Float64(x * z)) / Float64(t + x)); elseif (y <= 4.2e+48) tmp = Float64(z - Float64(Float64(b * y) / Float64(x + y))); else tmp = Float64(Float64(a + z) - b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.2e-59], N[(N[(a / N[(y + x), $MachinePrecision]), $MachinePrecision] * y + N[(z - b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.08e-193], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+48], N[(z - N[(N[(b * y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-59}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{y + x}, y, z - b\right)\\
\mathbf{elif}\;y \leq 1.08 \cdot 10^{-193}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{t + x}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+48}:\\
\;\;\;\;z - \frac{b \cdot y}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
if y < -2.1999999999999999e-59Initial program 61.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6440.1%
Applied rewrites40.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6456.7%
Applied rewrites56.7%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6465.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6465.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6465.1%
Applied rewrites65.1%
Taylor expanded in x around 0
Applied rewrites53.4%
if -2.1999999999999999e-59 < y < 1.08e-193Initial program 61.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6442.0%
Applied rewrites42.0%
if 1.08e-193 < y < 4.1999999999999997e48Initial program 61.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6440.1%
Applied rewrites40.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
add-to-fraction-revN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6456.7%
Applied rewrites56.7%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6440.7%
Applied rewrites40.7%
if 4.1999999999999997e48 < y Initial program 61.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6454.9%
Applied rewrites54.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma (/ (- a b) x) y z))) (if (<= x -3.4e+134) t_1 (if (<= x 2.2e+190) (- (+ a z) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((a - b) / x), y, z);
double tmp;
if (x <= -3.4e+134) {
tmp = t_1;
} else if (x <= 2.2e+190) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(Float64(a - b) / x), y, z) tmp = 0.0 if (x <= -3.4e+134) tmp = t_1; elseif (x <= 2.2e+190) tmp = Float64(Float64(a + z) - b); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(a - b), $MachinePrecision] / x), $MachinePrecision] * y + z), $MachinePrecision]}, If[LessEqual[x, -3.4e+134], t$95$1, If[LessEqual[x, 2.2e+190], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{a - b}{x}, y, z\right)\\
\mathbf{if}\;x \leq -3.4 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+190}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -3.4000000000000002e134 or 2.2e190 < x Initial program 61.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6440.1%
Applied rewrites40.1%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6434.0%
Applied rewrites34.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6434.0%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6434.1%
Applied rewrites34.1%
if -3.4000000000000002e134 < x < 2.2e190Initial program 61.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6454.9%
Applied rewrites54.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.32e+147) z (if (<= x 4.2e+183) (- (+ a z) b) (+ z (/ (* a y) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.32e+147) {
tmp = z;
} else if (x <= 4.2e+183) {
tmp = (a + z) - b;
} else {
tmp = z + ((a * y) / 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 <= (-1.32d+147)) then
tmp = z
else if (x <= 4.2d+183) then
tmp = (a + z) - b
else
tmp = z + ((a * y) / 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 <= -1.32e+147) {
tmp = z;
} else if (x <= 4.2e+183) {
tmp = (a + z) - b;
} else {
tmp = z + ((a * y) / x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.32e+147: tmp = z elif x <= 4.2e+183: tmp = (a + z) - b else: tmp = z + ((a * y) / x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.32e+147) tmp = z; elseif (x <= 4.2e+183) tmp = Float64(Float64(a + z) - b); else tmp = Float64(z + Float64(Float64(a * y) / x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.32e+147) tmp = z; elseif (x <= 4.2e+183) tmp = (a + z) - b; else tmp = z + ((a * y) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.32e+147], z, If[LessEqual[x, 4.2e+183], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(z + N[(N[(a * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \leq -1.32 \cdot 10^{+147}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+183}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z + \frac{a \cdot y}{x}\\
\end{array}
if x < -1.3200000000000001e147Initial program 61.8%
Taylor expanded in x around inf
Applied rewrites33.6%
if -1.3200000000000001e147 < x < 4.2e183Initial program 61.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6454.9%
Applied rewrites54.9%
if 4.2e183 < x Initial program 61.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6440.1%
Applied rewrites40.1%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6434.0%
Applied rewrites34.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6434.0%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6434.1%
Applied rewrites34.1%
Taylor expanded in b around 0
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6430.6%
Applied rewrites30.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.32e+147) z (if (<= x 1.05e+183) (- (+ a z) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.32e+147) {
tmp = z;
} else if (x <= 1.05e+183) {
tmp = (a + z) - 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 <= (-1.32d+147)) then
tmp = z
else if (x <= 1.05d+183) then
tmp = (a + z) - 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 <= -1.32e+147) {
tmp = z;
} else if (x <= 1.05e+183) {
tmp = (a + z) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.32e+147: tmp = z elif x <= 1.05e+183: tmp = (a + z) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.32e+147) tmp = z; elseif (x <= 1.05e+183) tmp = Float64(Float64(a + z) - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.32e+147) tmp = z; elseif (x <= 1.05e+183) tmp = (a + z) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.32e+147], z, If[LessEqual[x, 1.05e+183], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\mathbf{if}\;x \leq -1.32 \cdot 10^{+147}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+183}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
if x < -1.3200000000000001e147 or 1.05e183 < x Initial program 61.8%
Taylor expanded in x around inf
Applied rewrites33.6%
if -1.3200000000000001e147 < x < 1.05e183Initial program 61.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6454.9%
Applied rewrites54.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.1e+71) z (if (<= x 4.2e+47) (- a b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.1e+71) {
tmp = z;
} else if (x <= 4.2e+47) {
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 <= (-2.1d+71)) then
tmp = z
else if (x <= 4.2d+47) 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 <= -2.1e+71) {
tmp = z;
} else if (x <= 4.2e+47) {
tmp = a - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.1e+71: tmp = z elif x <= 4.2e+47: tmp = a - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.1e+71) tmp = z; elseif (x <= 4.2e+47) 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 <= -2.1e+71) tmp = z; elseif (x <= 4.2e+47) tmp = a - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.1e+71], z, If[LessEqual[x, 4.2e+47], N[(a - b), $MachinePrecision], z]]
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+71}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+47}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
if x < -2.0999999999999999e71 or 4.2e47 < x Initial program 61.8%
Taylor expanded in x around inf
Applied rewrites33.6%
if -2.0999999999999999e71 < x < 4.2e47Initial program 61.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6454.9%
Applied rewrites54.9%
Taylor expanded in z around 0
Applied rewrites35.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -0.00115) z (if (<= x 750.0) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -0.00115) {
tmp = z;
} else if (x <= 750.0) {
tmp = a;
} 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 <= (-0.00115d0)) then
tmp = z
else if (x <= 750.0d0) then
tmp = a
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 <= -0.00115) {
tmp = z;
} else if (x <= 750.0) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -0.00115: tmp = z elif x <= 750.0: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -0.00115) tmp = z; elseif (x <= 750.0) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -0.00115) tmp = z; elseif (x <= 750.0) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -0.00115], z, If[LessEqual[x, 750.0], a, z]]
\begin{array}{l}
\mathbf{if}\;x \leq -0.00115:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 750:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
if x < -0.00115 or 750 < x Initial program 61.8%
Taylor expanded in x around inf
Applied rewrites33.6%
if -0.00115 < x < 750Initial program 61.8%
Taylor expanded in t around inf
Applied rewrites31.8%
(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 61.8%
Taylor expanded in t around inf
Applied rewrites31.8%
herbie shell --seed 2025212
(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)))