
(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]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
Herbie found 14 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]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(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 (+ (+ t x) y))
(t_4
(fma (+ t y) (/ a t_3) (- (* (+ x y) (/ z t_1)) (* b (/ y t_1))))))
(if (<= t_2 (- INFINITY))
t_4
(if (<= t_2 1e+307)
(- (/ (fma a (+ t y) (* z (+ y x))) t_3) (* (/ y t_3) b))
t_4))))
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 = (t + x) + y;
double t_4 = fma((t + y), (a / t_3), (((x + y) * (z / t_1)) - (b * (y / t_1))));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_2 <= 1e+307) {
tmp = (fma(a, (t + y), (z * (y + x))) / t_3) - ((y / t_3) * b);
} else {
tmp = t_4;
}
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(Float64(t + x) + y) t_4 = fma(Float64(t + y), Float64(a / t_3), Float64(Float64(Float64(x + y) * Float64(z / t_1)) - Float64(b * Float64(y / t_1)))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_4; elseif (t_2 <= 1e+307) tmp = Float64(Float64(fma(a, Float64(t + y), Float64(z * Float64(y + x))) / t_3) - Float64(Float64(y / t_3) * b)); else tmp = t_4; 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[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t + y), $MachinePrecision] * N[(a / t$95$3), $MachinePrecision] + N[(N[(N[(x + y), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(b * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$4, If[LessEqual[t$95$2, 1e+307], N[(N[(N[(a * N[(t + y), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision] - N[(N[(y / t$95$3), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\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 := \left(t + x\right) + y\\
t_4 := \mathsf{fma}\left(t + y, \frac{a}{t\_3}, \left(x + y\right) \cdot \frac{z}{t\_1} - b \cdot \frac{y}{t\_1}\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq 10^{+307}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t + y, z \cdot \left(y + x\right)\right)}{t\_3} - \frac{y}{t\_3} \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\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.0 or 9.99999999999999986e306 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 61.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
associate--l+N/A
lift-*.f64N/A
associate-/l*N/A
remove-double-negN/A
mult-flip-revN/A
Applied rewrites68.2%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
Applied rewrites90.4%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.99999999999999986e306Initial program 61.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
Applied rewrites65.8%
(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)))
(t_3 (/ y (+ y t)))
(t_4 (- (+ a (* z t_3)) (* b t_3))))
(if (<= t_2 -4e+266)
t_4
(if (<= t_2 5e+296)
(- (/ (fma a (+ t y) (* z (+ y x))) t_1) (* (/ y t_1) b))
t_4))))
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 t_3 = y / (y + t);
double t_4 = (a + (z * t_3)) - (b * t_3);
double tmp;
if (t_2 <= -4e+266) {
tmp = t_4;
} else if (t_2 <= 5e+296) {
tmp = (fma(a, (t + y), (z * (y + x))) / t_1) - ((y / t_1) * b);
} else {
tmp = t_4;
}
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)) t_3 = Float64(y / Float64(y + t)) t_4 = Float64(Float64(a + Float64(z * t_3)) - Float64(b * t_3)) tmp = 0.0 if (t_2 <= -4e+266) tmp = t_4; elseif (t_2 <= 5e+296) tmp = Float64(Float64(fma(a, Float64(t + y), Float64(z * Float64(y + x))) / t_1) - Float64(Float64(y / t_1) * b)); else tmp = t_4; 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]}, Block[{t$95$3 = N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(a + N[(z * t$95$3), $MachinePrecision]), $MachinePrecision] - N[(b * t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+266], t$95$4, If[LessEqual[t$95$2, 5e+296], N[(N[(N[(a * N[(t + y), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] - N[(N[(y / t$95$1), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\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}\\
t_3 := \frac{y}{y + t}\\
t_4 := \left(a + z \cdot t\_3\right) - b \cdot t\_3\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+266}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+296}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t + y, z \cdot \left(y + x\right)\right)}{t\_1} - \frac{y}{t\_1} \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -4.0000000000000001e266 or 5.0000000000000001e296 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 61.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6440.7
Applied rewrites40.7%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lift-fma.f64N/A
add-to-fraction-revN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6468.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6468.2
Applied rewrites68.2%
if -4.0000000000000001e266 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000001e296Initial program 61.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
Applied rewrites65.8%
(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 (/ y (+ y t)))
(t_4 (- (+ a (* z t_3)) (* b t_3))))
(if (<= t_2 -4e+266)
t_4
(if (<= t_2 5e+296)
(/ (fma (+ y x) z (- (* a (+ t y)) (* b y))) t_1)
t_4))))
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 = y / (y + t);
double t_4 = (a + (z * t_3)) - (b * t_3);
double tmp;
if (t_2 <= -4e+266) {
tmp = t_4;
} else if (t_2 <= 5e+296) {
tmp = fma((y + x), z, ((a * (t + y)) - (b * y))) / t_1;
} else {
tmp = t_4;
}
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(y / Float64(y + t)) t_4 = Float64(Float64(a + Float64(z * t_3)) - Float64(b * t_3)) tmp = 0.0 if (t_2 <= -4e+266) tmp = t_4; elseif (t_2 <= 5e+296) tmp = Float64(fma(Float64(y + x), z, Float64(Float64(a * Float64(t + y)) - Float64(b * y))) / t_1); else tmp = t_4; 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[(y / N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(a + N[(z * t$95$3), $MachinePrecision]), $MachinePrecision] - N[(b * t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+266], t$95$4, If[LessEqual[t$95$2, 5e+296], N[(N[(N[(y + x), $MachinePrecision] * z + N[(N[(a * N[(t + y), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\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 := \frac{y}{y + t}\\
t_4 := \left(a + z \cdot t\_3\right) - b \cdot t\_3\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+266}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+296}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y + x, z, a \cdot \left(t + y\right) - b \cdot y\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -4.0000000000000001e266 or 5.0000000000000001e296 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 61.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6440.7
Applied rewrites40.7%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lift-fma.f64N/A
add-to-fraction-revN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6468.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6468.2
Applied rewrites68.2%
if -4.0000000000000001e266 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000001e296Initial program 61.1%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
add-flipN/A
sub-flip-reverseN/A
lift-*.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
remove-double-negN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
remove-double-neg61.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6461.3
Applied rewrites61.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ y (+ y t))))
(if (<= x -3.8e+166)
(* (/ (+ x y) (+ (+ x t) y)) z)
(if (<= x 2.5e-22)
(- (+ a (* z t_1)) (* b t_1))
(fma (+ t y) (/ a (+ (+ t x) y)) (- z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y / (y + t);
double tmp;
if (x <= -3.8e+166) {
tmp = ((x + y) / ((x + t) + y)) * z;
} else if (x <= 2.5e-22) {
tmp = (a + (z * t_1)) - (b * t_1);
} else {
tmp = fma((t + y), (a / ((t + x) + y)), (z - b));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y / Float64(y + t)) tmp = 0.0 if (x <= -3.8e+166) tmp = Float64(Float64(Float64(x + y) / Float64(Float64(x + t) + y)) * z); elseif (x <= 2.5e-22) tmp = Float64(Float64(a + Float64(z * t_1)) - Float64(b * t_1)); else tmp = fma(Float64(t + y), Float64(a / Float64(Float64(t + x) + y)), Float64(z - b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.8e+166], N[(N[(N[(x + y), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[x, 2.5e-22], N[(N[(a + N[(z * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(b * t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(t + y), $MachinePrecision] * N[(a / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{y + t}\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{+166}:\\
\;\;\;\;\frac{x + y}{\left(x + t\right) + y} \cdot z\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-22}:\\
\;\;\;\;\left(a + z \cdot t\_1\right) - b \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t + y, \frac{a}{\left(t + x\right) + y}, z - b\right)\\
\end{array}
\end{array}
if x < -3.80000000000000007e166Initial program 61.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6425.4
Applied rewrites25.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
lift-+.f64N/A
lower-/.f6440.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6440.1
Applied rewrites40.1%
if -3.80000000000000007e166 < x < 2.49999999999999977e-22Initial program 61.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6440.7
Applied rewrites40.7%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lift-fma.f64N/A
add-to-fraction-revN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6468.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6468.2
Applied rewrites68.2%
if 2.49999999999999977e-22 < x Initial program 61.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
associate--l+N/A
lift-*.f64N/A
associate-/l*N/A
remove-double-negN/A
mult-flip-revN/A
Applied rewrites68.2%
Taylor expanded in y around inf
lower--.f6462.8
Applied rewrites62.8%
(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 (fma a (/ (+ t y) (+ (+ t x) y)) (- z b))))
(if (<= t_1 -4e+266)
t_2
(if (<= t_1 1e+210)
(/ (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 = fma(a, ((t + y) / ((t + x) + y)), (z - b));
double tmp;
if (t_1 <= -4e+266) {
tmp = t_2;
} else if (t_1 <= 1e+210) {
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 = fma(a, Float64(Float64(t + y) / Float64(Float64(t + x) + y)), Float64(z - b)) tmp = 0.0 if (t_1 <= -4e+266) tmp = t_2; elseif (t_1 <= 1e+210) 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[(a * N[(N[(t + y), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+266], t$95$2, If[LessEqual[t$95$1, 1e+210], 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}
\\
\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 := \mathsf{fma}\left(a, \frac{t + y}{\left(t + x\right) + y}, z - b\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+266}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+210}:\\
\;\;\;\;\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}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -4.0000000000000001e266 or 9.99999999999999927e209 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 61.1%
lift-/.f64N/A
lift--.f64N/A
sub-flipN/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites72.6%
Taylor expanded in y around inf
lower--.f6464.9
Applied rewrites64.9%
if -4.0000000000000001e266 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.99999999999999927e209Initial program 61.1%
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-+.f6447.9
Applied rewrites47.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- a (/ (* y (- b z)) (+ y t)))) (t_2 (- a (- b z))))
(if (<= y -1.1e+101)
t_2
(if (<= y -2.1e-165)
t_1
(if (<= y 9.5e-176)
(/ (fma a t (* x z)) (+ t x))
(if (<= y 1.3e+103) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a - ((y * (b - z)) / (y + t));
double t_2 = a - (b - z);
double tmp;
if (y <= -1.1e+101) {
tmp = t_2;
} else if (y <= -2.1e-165) {
tmp = t_1;
} else if (y <= 9.5e-176) {
tmp = fma(a, t, (x * z)) / (t + x);
} else if (y <= 1.3e+103) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(a - Float64(Float64(y * Float64(b - z)) / Float64(y + t))) t_2 = Float64(a - Float64(b - z)) tmp = 0.0 if (y <= -1.1e+101) tmp = t_2; elseif (y <= -2.1e-165) tmp = t_1; elseif (y <= 9.5e-176) tmp = Float64(fma(a, t, Float64(x * z)) / Float64(t + x)); elseif (y <= 1.3e+103) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a - N[(N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a - N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.1e+101], t$95$2, If[LessEqual[y, -2.1e-165], t$95$1, If[LessEqual[y, 9.5e-176], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e+103], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a - \frac{y \cdot \left(b - z\right)}{y + t}\\
t_2 := a - \left(b - z\right)\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{+101}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-165}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-176}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{t + x}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+103}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.1e101 or 1.3000000000000001e103 < y Initial program 61.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.7
Applied rewrites56.7%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
add-flipN/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6456.7
Applied rewrites56.7%
if -1.1e101 < y < -2.09999999999999995e-165 or 9.5e-176 < y < 1.3000000000000001e103Initial program 61.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6440.7
Applied rewrites40.7%
lift-/.f64N/A
lift--.f64N/A
lift-fma.f64N/A
add-flipN/A
associate--l-N/A
sub-to-fraction-revN/A
add-flip-revN/A
sub-flipN/A
distribute-neg-inN/A
sub-flipN/A
sub-negate-revN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites51.2%
if -2.09999999999999995e-165 < y < 9.5e-176Initial program 61.1%
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 y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
(t_2 (fma a (/ (+ t y) (+ (+ t x) y)) (- z b))))
(if (<= t_1 -2e+50)
t_2
(if (<= t_1 5e+182) (/ (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 = fma(a, ((t + y) / ((t + x) + y)), (z - b));
double tmp;
if (t_1 <= -2e+50) {
tmp = t_2;
} else if (t_1 <= 5e+182) {
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 = fma(a, Float64(Float64(t + y) / Float64(Float64(t + x) + y)), Float64(z - b)) tmp = 0.0 if (t_1 <= -2e+50) tmp = t_2; elseif (t_1 <= 5e+182) 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[(a * N[(N[(t + y), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+50], t$95$2, If[LessEqual[t$95$1, 5e+182], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\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 := \mathsf{fma}\left(a, \frac{t + y}{\left(t + x\right) + y}, z - b\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+50}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+182}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\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.0000000000000002e50 or 4.99999999999999973e182 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 61.1%
lift-/.f64N/A
lift--.f64N/A
sub-flipN/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites72.6%
Taylor expanded in y around inf
lower--.f6464.9
Applied rewrites64.9%
if -2.0000000000000002e50 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.99999999999999973e182Initial program 61.1%
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 y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
(t_2 (- a (- b z))))
(if (<= t_1 -2e+145)
t_2
(if (<= t_1 5e+182) (/ (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 - (b - z);
double tmp;
if (t_1 <= -2e+145) {
tmp = t_2;
} else if (t_1 <= 5e+182) {
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(a - Float64(b - z)) tmp = 0.0 if (t_1 <= -2e+145) tmp = t_2; elseif (t_1 <= 5e+182) 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[(a - N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+145], t$95$2, If[LessEqual[t$95$1, 5e+182], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\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 := a - \left(b - z\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+145}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+182}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2e145 or 4.99999999999999973e182 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 61.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.7
Applied rewrites56.7%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
add-flipN/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6456.7
Applied rewrites56.7%
if -2e145 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.99999999999999973e182Initial program 61.1%
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 (<= t -3.1e+99) (- a (* (/ (- b z) t) y)) (if (<= t 7.4e+132) (- a (- b z)) (fma (/ (- z b) t) y a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.1e+99) {
tmp = a - (((b - z) / t) * y);
} else if (t <= 7.4e+132) {
tmp = a - (b - z);
} else {
tmp = fma(((z - b) / t), y, a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.1e+99) tmp = Float64(a - Float64(Float64(Float64(b - z) / t) * y)); elseif (t <= 7.4e+132) tmp = Float64(a - Float64(b - z)); else tmp = fma(Float64(Float64(z - b) / t), y, a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.1e+99], N[(a - N[(N[(N[(b - z), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.4e+132], N[(a - N[(b - z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z - b), $MachinePrecision] / t), $MachinePrecision] * y + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{+99}:\\
\;\;\;\;a - \frac{b - z}{t} \cdot y\\
\mathbf{elif}\;t \leq 7.4 \cdot 10^{+132}:\\
\;\;\;\;a - \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - b}{t}, y, a\right)\\
\end{array}
\end{array}
if t < -3.1000000000000001e99Initial program 61.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6440.7
Applied rewrites40.7%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6432.8
Applied rewrites32.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6432.8
Applied rewrites32.8%
if -3.1000000000000001e99 < t < 7.40000000000000022e132Initial program 61.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.7
Applied rewrites56.7%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
add-flipN/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6456.7
Applied rewrites56.7%
if 7.40000000000000022e132 < t Initial program 61.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6440.7
Applied rewrites40.7%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6432.8
Applied rewrites32.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6432.8
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6432.8
Applied rewrites32.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma (/ (- z b) t) y a))) (if (<= t -3.1e+99) t_1 (if (<= t 7.4e+132) (- a (- b z)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((z - b) / t), y, a);
double tmp;
if (t <= -3.1e+99) {
tmp = t_1;
} else if (t <= 7.4e+132) {
tmp = a - (b - z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(Float64(z - b) / t), y, a) tmp = 0.0 if (t <= -3.1e+99) tmp = t_1; elseif (t <= 7.4e+132) tmp = Float64(a - Float64(b - z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(z - b), $MachinePrecision] / t), $MachinePrecision] * y + a), $MachinePrecision]}, If[LessEqual[t, -3.1e+99], t$95$1, If[LessEqual[t, 7.4e+132], N[(a - N[(b - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{z - b}{t}, y, a\right)\\
\mathbf{if}\;t \leq -3.1 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.4 \cdot 10^{+132}:\\
\;\;\;\;a - \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.1000000000000001e99 or 7.40000000000000022e132 < t Initial program 61.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6440.7
Applied rewrites40.7%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6432.8
Applied rewrites32.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6432.8
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6432.8
Applied rewrites32.8%
if -3.1000000000000001e99 < t < 7.40000000000000022e132Initial program 61.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.7
Applied rewrites56.7%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
add-flipN/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6456.7
Applied rewrites56.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -4.3e+181) z (- a (- b z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.3e+181) {
tmp = z;
} else {
tmp = a - (b - 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 <= (-4.3d+181)) then
tmp = z
else
tmp = a - (b - 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 <= -4.3e+181) {
tmp = z;
} else {
tmp = a - (b - z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -4.3e+181: tmp = z else: tmp = a - (b - z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -4.3e+181) tmp = z; else tmp = Float64(a - Float64(b - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -4.3e+181) tmp = z; else tmp = a - (b - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.3e+181], z, N[(a - N[(b - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.3 \cdot 10^{+181}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a - \left(b - z\right)\\
\end{array}
\end{array}
if x < -4.29999999999999972e181Initial program 61.1%
Taylor expanded in x around inf
Applied rewrites32.8%
if -4.29999999999999972e181 < x Initial program 61.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.7
Applied rewrites56.7%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
add-flipN/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6456.7
Applied rewrites56.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.4e+59) z (if (<= z 6e+135) (- a b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.4e+59) {
tmp = z;
} else if (z <= 6e+135) {
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 (z <= (-1.4d+59)) then
tmp = z
else if (z <= 6d+135) 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 (z <= -1.4e+59) {
tmp = z;
} else if (z <= 6e+135) {
tmp = a - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.4e+59: tmp = z elif z <= 6e+135: tmp = a - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.4e+59) tmp = z; elseif (z <= 6e+135) 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 (z <= -1.4e+59) tmp = z; elseif (z <= 6e+135) tmp = a - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.4e+59], z, If[LessEqual[z, 6e+135], N[(a - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+59}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+135}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -1.3999999999999999e59 or 6.0000000000000001e135 < z Initial program 61.1%
Taylor expanded in x around inf
Applied rewrites32.8%
if -1.3999999999999999e59 < z < 6.0000000000000001e135Initial program 61.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.7
Applied rewrites56.7%
Taylor expanded in z around 0
lower--.f6438.1
Applied rewrites38.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.4e+59) z (if (<= z 9.8e+58) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.4e+59) {
tmp = z;
} else if (z <= 9.8e+58) {
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 (z <= (-1.4d+59)) then
tmp = z
else if (z <= 9.8d+58) 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 (z <= -1.4e+59) {
tmp = z;
} else if (z <= 9.8e+58) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.4e+59: tmp = z elif z <= 9.8e+58: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.4e+59) tmp = z; elseif (z <= 9.8e+58) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.4e+59) tmp = z; elseif (z <= 9.8e+58) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.4e+59], z, If[LessEqual[z, 9.8e+58], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+59}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+58}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -1.3999999999999999e59 or 9.80000000000000037e58 < z Initial program 61.1%
Taylor expanded in x around inf
Applied rewrites32.8%
if -1.3999999999999999e59 < z < 9.80000000000000037e58Initial program 61.1%
Taylor expanded in t around inf
Applied rewrites32.5%
(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
\begin{array}{l}
\\
a
\end{array}
Initial program 61.1%
Taylor expanded in t around inf
Applied rewrites32.5%
herbie shell --seed 2025156
(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)))