
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - 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 - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - 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 - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- t a) z (* x y)))
(t_2
(fma
(/ y (fma (- b y) z y))
x
(* (- t a) (* (/ 1.0 (fma z (- b y) y)) z))))
(t_3 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y))))))
(if (<= t_3 -1e-36)
t_2
(if (<= t_3 2e-19)
(/ 1.0 (fma (- b y) (/ z t_1) (/ y t_1)))
(if (<= t_3 INFINITY) t_2 (/ (- t a) (- b y)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((t - a), z, (x * y));
double t_2 = fma((y / fma((b - y), z, y)), x, ((t - a) * ((1.0 / fma(z, (b - y), y)) * z)));
double t_3 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double tmp;
if (t_3 <= -1e-36) {
tmp = t_2;
} else if (t_3 <= 2e-19) {
tmp = 1.0 / fma((b - y), (z / t_1), (y / t_1));
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(t - a), z, Float64(x * y)) t_2 = fma(Float64(y / fma(Float64(b - y), z, y)), x, Float64(Float64(t - a) * Float64(Float64(1.0 / fma(z, Float64(b - y), y)) * z))) t_3 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) tmp = 0.0 if (t_3 <= -1e-36) tmp = t_2; elseif (t_3 <= 2e-19) tmp = Float64(1.0 / fma(Float64(b - y), Float64(z / t_1), Float64(y / t_1))); elseif (t_3 <= Inf) tmp = t_2; else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] * z + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] * x + N[(N[(t - a), $MachinePrecision] * N[(N[(1.0 / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e-36], t$95$2, If[LessEqual[t$95$3, 2e-19], N[(1.0 / N[(N[(b - y), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$2, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - a, z, x \cdot y\right)\\
t_2 := \mathsf{fma}\left(\frac{y}{\mathsf{fma}\left(b - y, z, y\right)}, x, \left(t - a\right) \cdot \left(\frac{1}{\mathsf{fma}\left(z, b - y, y\right)} \cdot z\right)\right)\\
t_3 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{-36}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-19}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(b - y, \frac{z}{t\_1}, \frac{y}{t\_1}\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -9.9999999999999994e-37 or 2e-19 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 66.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites75.7%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6480.1
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6480.1
Applied rewrites80.1%
if -9.9999999999999994e-37 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2e-19Initial program 66.7%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6466.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.6
Applied rewrites66.6%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites70.6%
if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 66.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y)))
(t_2 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_3 (fma (- b y) z y))
(t_4 (/ (fma (- t a) z (* y x)) t_3))
(t_5 (/ (- t a) t_3)))
(if (<= t_2 (- INFINITY))
(fma t_5 z (* (/ x t_3) y))
(if (<= t_2 -1e-301)
t_4
(if (<= t_2 0.0)
t_1
(if (<= t_2 5e+286)
t_4
(if (<= t_2 INFINITY) (fma (/ y t_3) x (* t_5 z)) t_1)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double t_2 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_3 = fma((b - y), z, y);
double t_4 = fma((t - a), z, (y * x)) / t_3;
double t_5 = (t - a) / t_3;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = fma(t_5, z, ((x / t_3) * y));
} else if (t_2 <= -1e-301) {
tmp = t_4;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 5e+286) {
tmp = t_4;
} else if (t_2 <= ((double) INFINITY)) {
tmp = fma((y / t_3), x, (t_5 * z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) t_2 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_3 = fma(Float64(b - y), z, y) t_4 = Float64(fma(Float64(t - a), z, Float64(y * x)) / t_3) t_5 = Float64(Float64(t - a) / t_3) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = fma(t_5, z, Float64(Float64(x / t_3) * y)); elseif (t_2 <= -1e-301) tmp = t_4; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= 5e+286) tmp = t_4; elseif (t_2 <= Inf) tmp = fma(Float64(y / t_3), x, Float64(t_5 * z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t - a), $MachinePrecision] / t$95$3), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(t$95$5 * z + N[(N[(x / t$95$3), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -1e-301], t$95$4, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 5e+286], t$95$4, If[LessEqual[t$95$2, Infinity], N[(N[(y / t$95$3), $MachinePrecision] * x + N[(t$95$5 * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_3 := \mathsf{fma}\left(b - y, z, y\right)\\
t_4 := \frac{\mathsf{fma}\left(t - a, z, y \cdot x\right)}{t\_3}\\
t_5 := \frac{t - a}{t\_3}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(t\_5, z, \frac{x}{t\_3} \cdot y\right)\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-301}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+286}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t\_3}, x, t\_5 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0Initial program 66.7%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites70.2%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.00000000000000007e-301 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.0000000000000004e286Initial program 66.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.7
Applied rewrites66.7%
if -1.00000000000000007e-301 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 66.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
if 5.0000000000000004e286 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 66.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites75.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y)))
(t_2 (fma (- b y) z y))
(t_3 (/ (fma (- t a) z (* y x)) t_2))
(t_4 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_5 (fma (/ y t_2) x (* (/ (- t a) t_2) z))))
(if (<= t_4 (- INFINITY))
t_5
(if (<= t_4 -1e-301)
t_3
(if (<= t_4 0.0)
t_1
(if (<= t_4 5e+286) t_3 (if (<= t_4 INFINITY) t_5 t_1)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double t_2 = fma((b - y), z, y);
double t_3 = fma((t - a), z, (y * x)) / t_2;
double t_4 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_5 = fma((y / t_2), x, (((t - a) / t_2) * z));
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_4 <= -1e-301) {
tmp = t_3;
} else if (t_4 <= 0.0) {
tmp = t_1;
} else if (t_4 <= 5e+286) {
tmp = t_3;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_5;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) t_2 = fma(Float64(b - y), z, y) t_3 = Float64(fma(Float64(t - a), z, Float64(y * x)) / t_2) t_4 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_5 = fma(Float64(y / t_2), x, Float64(Float64(Float64(t - a) / t_2) * z)) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_5; elseif (t_4 <= -1e-301) tmp = t_3; elseif (t_4 <= 0.0) tmp = t_1; elseif (t_4 <= 5e+286) tmp = t_3; elseif (t_4 <= Inf) tmp = t_5; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(y / t$95$2), $MachinePrecision] * x + N[(N[(N[(t - a), $MachinePrecision] / t$95$2), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$5, If[LessEqual[t$95$4, -1e-301], t$95$3, If[LessEqual[t$95$4, 0.0], t$95$1, If[LessEqual[t$95$4, 5e+286], t$95$3, If[LessEqual[t$95$4, Infinity], t$95$5, t$95$1]]]]]]]]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
t_2 := \mathsf{fma}\left(b - y, z, y\right)\\
t_3 := \frac{\mathsf{fma}\left(t - a, z, y \cdot x\right)}{t\_2}\\
t_4 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_5 := \mathsf{fma}\left(\frac{y}{t\_2}, x, \frac{t - a}{t\_2} \cdot z\right)\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq -1 \cdot 10^{-301}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+286}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 5.0000000000000004e286 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 66.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites75.7%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.00000000000000007e-301 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.0000000000000004e286Initial program 66.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.7
Applied rewrites66.7%
if -1.00000000000000007e-301 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 66.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.75e+74)
t_1
(if (<= z 4.8e+91)
(fma
(/ y (fma (- b y) z y))
x
(* (- t a) (* (/ 1.0 (fma z (- b y) y)) z)))
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -1.75e+74) {
tmp = t_1;
} else if (z <= 4.8e+91) {
tmp = fma((y / fma((b - y), z, y)), x, ((t - a) * ((1.0 / fma(z, (b - y), y)) * z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.75e+74) tmp = t_1; elseif (z <= 4.8e+91) tmp = fma(Float64(y / fma(Float64(b - y), z, y)), x, Float64(Float64(t - a) * Float64(Float64(1.0 / fma(z, Float64(b - y), y)) * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+74], t$95$1, If[LessEqual[z, 4.8e+91], N[(N[(y / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] * x + N[(N[(t - a), $MachinePrecision] * N[(N[(1.0 / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+91}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{\mathsf{fma}\left(b - y, z, y\right)}, x, \left(t - a\right) \cdot \left(\frac{1}{\mathsf{fma}\left(z, b - y, y\right)} \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.75000000000000007e74 or 4.79999999999999966e91 < z Initial program 66.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
if -1.75000000000000007e74 < z < 4.79999999999999966e91Initial program 66.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites75.7%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6480.1
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6480.1
Applied rewrites80.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y)))
(t_2 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_3 (fma (- b y) z y))
(t_4 (/ (fma (- t a) z (* y x)) t_3)))
(if (<= t_2 (- INFINITY))
(fma 1.0 x (* (/ (- t a) t_3) z))
(if (<= t_2 -1e-301)
t_4
(if (<= t_2 0.0)
t_1
(if (<= t_2 5e+237)
t_4
(if (<= t_2 INFINITY)
(fma 1.0 x (* (- t a) (* (/ 1.0 (fma z (- b y) y)) z)))
t_1)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double t_2 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_3 = fma((b - y), z, y);
double t_4 = fma((t - a), z, (y * x)) / t_3;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = fma(1.0, x, (((t - a) / t_3) * z));
} else if (t_2 <= -1e-301) {
tmp = t_4;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 5e+237) {
tmp = t_4;
} else if (t_2 <= ((double) INFINITY)) {
tmp = fma(1.0, x, ((t - a) * ((1.0 / fma(z, (b - y), y)) * z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) t_2 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_3 = fma(Float64(b - y), z, y) t_4 = Float64(fma(Float64(t - a), z, Float64(y * x)) / t_3) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = fma(1.0, x, Float64(Float64(Float64(t - a) / t_3) * z)); elseif (t_2 <= -1e-301) tmp = t_4; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= 5e+237) tmp = t_4; elseif (t_2 <= Inf) tmp = fma(1.0, x, Float64(Float64(t - a) * Float64(Float64(1.0 / fma(z, Float64(b - y), y)) * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(1.0 * x + N[(N[(N[(t - a), $MachinePrecision] / t$95$3), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -1e-301], t$95$4, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 5e+237], t$95$4, If[LessEqual[t$95$2, Infinity], N[(1.0 * x + N[(N[(t - a), $MachinePrecision] * N[(N[(1.0 / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_3 := \mathsf{fma}\left(b - y, z, y\right)\\
t_4 := \frac{\mathsf{fma}\left(t - a, z, y \cdot x\right)}{t\_3}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(1, x, \frac{t - a}{t\_3} \cdot z\right)\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-301}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+237}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(1, x, \left(t - a\right) \cdot \left(\frac{1}{\mathsf{fma}\left(z, b - y, y\right)} \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0Initial program 66.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites75.7%
Taylor expanded in z around 0
Applied rewrites56.3%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.00000000000000007e-301 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.0000000000000002e237Initial program 66.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.7
Applied rewrites66.7%
if -1.00000000000000007e-301 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 66.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
if 5.0000000000000002e237 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 66.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites75.7%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6480.1
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6480.1
Applied rewrites80.1%
Taylor expanded in z around 0
Applied rewrites59.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y)))
(t_2 (fma (- b y) z y))
(t_3 (/ (fma (- t a) z (* y x)) t_2))
(t_4 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_5 (fma 1.0 x (* (/ (- t a) t_2) z))))
(if (<= t_4 (- INFINITY))
t_5
(if (<= t_4 -1e-301)
t_3
(if (<= t_4 0.0)
t_1
(if (<= t_4 5e+286) t_3 (if (<= t_4 INFINITY) t_5 t_1)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double t_2 = fma((b - y), z, y);
double t_3 = fma((t - a), z, (y * x)) / t_2;
double t_4 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_5 = fma(1.0, x, (((t - a) / t_2) * z));
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_4 <= -1e-301) {
tmp = t_3;
} else if (t_4 <= 0.0) {
tmp = t_1;
} else if (t_4 <= 5e+286) {
tmp = t_3;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_5;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) t_2 = fma(Float64(b - y), z, y) t_3 = Float64(fma(Float64(t - a), z, Float64(y * x)) / t_2) t_4 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_5 = fma(1.0, x, Float64(Float64(Float64(t - a) / t_2) * z)) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_5; elseif (t_4 <= -1e-301) tmp = t_3; elseif (t_4 <= 0.0) tmp = t_1; elseif (t_4 <= 5e+286) tmp = t_3; elseif (t_4 <= Inf) tmp = t_5; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(1.0 * x + N[(N[(N[(t - a), $MachinePrecision] / t$95$2), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$5, If[LessEqual[t$95$4, -1e-301], t$95$3, If[LessEqual[t$95$4, 0.0], t$95$1, If[LessEqual[t$95$4, 5e+286], t$95$3, If[LessEqual[t$95$4, Infinity], t$95$5, t$95$1]]]]]]]]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
t_2 := \mathsf{fma}\left(b - y, z, y\right)\\
t_3 := \frac{\mathsf{fma}\left(t - a, z, y \cdot x\right)}{t\_2}\\
t_4 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_5 := \mathsf{fma}\left(1, x, \frac{t - a}{t\_2} \cdot z\right)\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq -1 \cdot 10^{-301}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+286}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 5.0000000000000004e286 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 66.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites75.7%
Taylor expanded in z around 0
Applied rewrites56.3%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.00000000000000007e-301 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.0000000000000004e286Initial program 66.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.7
Applied rewrites66.7%
if -1.00000000000000007e-301 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 66.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.75e+74)
t_1
(if (<= z 6.1e+38) (/ (fma (- t a) z (* y x)) (fma (- b y) z y)) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -1.75e+74) {
tmp = t_1;
} else if (z <= 6.1e+38) {
tmp = fma((t - a), z, (y * x)) / fma((b - y), z, y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.75e+74) tmp = t_1; elseif (z <= 6.1e+38) tmp = Float64(fma(Float64(t - a), z, Float64(y * x)) / fma(Float64(b - y), z, y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+74], t$95$1, If[LessEqual[z, 6.1e+38], N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.1 \cdot 10^{+38}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t - a, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.75000000000000007e74 or 6.0999999999999999e38 < z Initial program 66.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
if -1.75000000000000007e74 < z < 6.0999999999999999e38Initial program 66.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.7
Applied rewrites66.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.8e+14)
t_1
(if (<= z 33.0) (/ (fma (- t a) z (* x y)) (fma b z y)) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -1.8e+14) {
tmp = t_1;
} else if (z <= 33.0) {
tmp = fma((t - a), z, (x * y)) / fma(b, z, y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.8e+14) tmp = t_1; elseif (z <= 33.0) tmp = Float64(fma(Float64(t - a), z, Float64(x * y)) / fma(b, z, y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+14], t$95$1, If[LessEqual[z, 33.0], N[(N[(N[(t - a), $MachinePrecision] * z + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(b * z + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 33:\\
\;\;\;\;\frac{\mathsf{fma}\left(t - a, z, x \cdot y\right)}{\mathsf{fma}\left(b, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.8e14 or 33 < z Initial program 66.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
if -1.8e14 < z < 33Initial program 66.7%
Taylor expanded in y around 0
Applied rewrites57.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6457.2
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6457.2
Applied rewrites57.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -3.6e+34)
t_1
(if (<= z -1.1e-47)
(/ (* (- t a) z) (fma z (- b y) y))
(if (<= z 5.8e-34) (/ x (+ 1.0 (/ (* z (- b y)) y))) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -3.6e+34) {
tmp = t_1;
} else if (z <= -1.1e-47) {
tmp = ((t - a) * z) / fma(z, (b - y), y);
} else if (z <= 5.8e-34) {
tmp = x / (1.0 + ((z * (b - y)) / y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -3.6e+34) tmp = t_1; elseif (z <= -1.1e-47) tmp = Float64(Float64(Float64(t - a) * z) / fma(z, Float64(b - y), y)); elseif (z <= 5.8e-34) tmp = Float64(x / Float64(1.0 + Float64(Float64(z * Float64(b - y)) / y))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e+34], t$95$1, If[LessEqual[z, -1.1e-47], N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-34], N[(x / N[(1.0 + N[(N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-47}:\\
\;\;\;\;\frac{\left(t - a\right) \cdot z}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-34}:\\
\;\;\;\;\frac{x}{1 + \frac{z \cdot \left(b - y\right)}{y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.6e34 or 5.8000000000000004e-34 < z Initial program 66.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
if -3.6e34 < z < -1.10000000000000009e-47Initial program 66.7%
Taylor expanded in t around inf
lower-*.f6423.7
Applied rewrites23.7%
lift-/.f64N/A
mult-flipN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
+-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.6
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6423.6
Applied rewrites23.6%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6441.8
Applied rewrites41.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6441.9
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6441.9
Applied rewrites41.9%
if -1.10000000000000009e-47 < z < 5.8000000000000004e-34Initial program 66.7%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6466.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.6
Applied rewrites66.6%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites70.6%
Taylor expanded in x around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6436.9
Applied rewrites36.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -3.6e-48)
t_1
(if (<= z 5.8e-34) (/ x (+ 1.0 (/ (* z (- b y)) y))) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -3.6e-48) {
tmp = t_1;
} else if (z <= 5.8e-34) {
tmp = x / (1.0 + ((z * (b - y)) / y));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-3.6d-48)) then
tmp = t_1
else if (z <= 5.8d-34) then
tmp = x / (1.0d0 + ((z * (b - y)) / y))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -3.6e-48) {
tmp = t_1;
} else if (z <= 5.8e-34) {
tmp = x / (1.0 + ((z * (b - y)) / y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -3.6e-48: tmp = t_1 elif z <= 5.8e-34: tmp = x / (1.0 + ((z * (b - y)) / y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -3.6e-48) tmp = t_1; elseif (z <= 5.8e-34) tmp = Float64(x / Float64(1.0 + Float64(Float64(z * Float64(b - y)) / y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -3.6e-48) tmp = t_1; elseif (z <= 5.8e-34) tmp = x / (1.0 + ((z * (b - y)) / y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e-48], t$95$1, If[LessEqual[z, 5.8e-34], N[(x / N[(1.0 + N[(N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-34}:\\
\;\;\;\;\frac{x}{1 + \frac{z \cdot \left(b - y\right)}{y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.6000000000000002e-48 or 5.8000000000000004e-34 < z Initial program 66.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
if -3.6000000000000002e-48 < z < 5.8000000000000004e-34Initial program 66.7%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6466.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.6
Applied rewrites66.6%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites70.6%
Taylor expanded in x around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6436.9
Applied rewrites36.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -3.6e-48)
t_1
(if (<= z 1.28e-179) (/ (* x y) (+ y (* z (- b y)))) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -3.6e-48) {
tmp = t_1;
} else if (z <= 1.28e-179) {
tmp = (x * y) / (y + (z * (b - y)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-3.6d-48)) then
tmp = t_1
else if (z <= 1.28d-179) then
tmp = (x * y) / (y + (z * (b - y)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -3.6e-48) {
tmp = t_1;
} else if (z <= 1.28e-179) {
tmp = (x * y) / (y + (z * (b - y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -3.6e-48: tmp = t_1 elif z <= 1.28e-179: tmp = (x * y) / (y + (z * (b - y))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -3.6e-48) tmp = t_1; elseif (z <= 1.28e-179) tmp = Float64(Float64(x * y) / Float64(y + Float64(z * Float64(b - y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -3.6e-48) tmp = t_1; elseif (z <= 1.28e-179) tmp = (x * y) / (y + (z * (b - y))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e-48], t$95$1, If[LessEqual[z, 1.28e-179], N[(N[(x * y), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.28 \cdot 10^{-179}:\\
\;\;\;\;\frac{x \cdot y}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.6000000000000002e-48 or 1.28000000000000006e-179 < z Initial program 66.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
if -3.6000000000000002e-48 < z < 1.28000000000000006e-179Initial program 66.7%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6429.3
Applied rewrites29.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* -1.0 (/ x (- z 1.0))))) (if (<= y -2.2e+16) t_1 (if (<= y 1.42e+96) (/ (- t a) (- b y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -1.0 * (x / (z - 1.0));
double tmp;
if (y <= -2.2e+16) {
tmp = t_1;
} else if (y <= 1.42e+96) {
tmp = (t - a) / (b - y);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (-1.0d0) * (x / (z - 1.0d0))
if (y <= (-2.2d+16)) then
tmp = t_1
else if (y <= 1.42d+96) then
tmp = (t - a) / (b - y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -1.0 * (x / (z - 1.0));
double tmp;
if (y <= -2.2e+16) {
tmp = t_1;
} else if (y <= 1.42e+96) {
tmp = (t - a) / (b - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -1.0 * (x / (z - 1.0)) tmp = 0 if y <= -2.2e+16: tmp = t_1 elif y <= 1.42e+96: tmp = (t - a) / (b - y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(-1.0 * Float64(x / Float64(z - 1.0))) tmp = 0.0 if (y <= -2.2e+16) tmp = t_1; elseif (y <= 1.42e+96) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -1.0 * (x / (z - 1.0)); tmp = 0.0; if (y <= -2.2e+16) tmp = t_1; elseif (y <= 1.42e+96) tmp = (t - a) / (b - y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-1.0 * N[(x / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e+16], t$95$1, If[LessEqual[y, 1.42e+96], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := -1 \cdot \frac{x}{z - 1}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.42 \cdot 10^{+96}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -2.2e16 or 1.41999999999999995e96 < y Initial program 66.7%
Taylor expanded in y around -inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6433.5
Applied rewrites33.5%
if -2.2e16 < y < 1.41999999999999995e96Initial program 66.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -3.6e-48) t_1 (if (<= z 5.8e-34) (/ 1.0 (/ 1.0 x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -3.6e-48) {
tmp = t_1;
} else if (z <= 5.8e-34) {
tmp = 1.0 / (1.0 / x);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-3.6d-48)) then
tmp = t_1
else if (z <= 5.8d-34) then
tmp = 1.0d0 / (1.0d0 / x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -3.6e-48) {
tmp = t_1;
} else if (z <= 5.8e-34) {
tmp = 1.0 / (1.0 / x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -3.6e-48: tmp = t_1 elif z <= 5.8e-34: tmp = 1.0 / (1.0 / x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -3.6e-48) tmp = t_1; elseif (z <= 5.8e-34) tmp = Float64(1.0 / Float64(1.0 / x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -3.6e-48) tmp = t_1; elseif (z <= 5.8e-34) tmp = 1.0 / (1.0 / x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e-48], t$95$1, If[LessEqual[z, 5.8e-34], N[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-34}:\\
\;\;\;\;\frac{1}{\frac{1}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.6000000000000002e-48 or 5.8000000000000004e-34 < z Initial program 66.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
if -3.6000000000000002e-48 < z < 5.8000000000000004e-34Initial program 66.7%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6466.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.6
Applied rewrites66.6%
Taylor expanded in z around 0
lower-/.f6425.8
Applied rewrites25.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ 1.0 (/ 1.0 x)))) (if (<= y -1.05e+19) t_1 (if (<= y 9.5e-41) (/ (- t a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 / (1.0 / x);
double tmp;
if (y <= -1.05e+19) {
tmp = t_1;
} else if (y <= 9.5e-41) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 / (1.0d0 / x)
if (y <= (-1.05d+19)) then
tmp = t_1
else if (y <= 9.5d-41) then
tmp = (t - a) / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 / (1.0 / x);
double tmp;
if (y <= -1.05e+19) {
tmp = t_1;
} else if (y <= 9.5e-41) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = 1.0 / (1.0 / x) tmp = 0 if y <= -1.05e+19: tmp = t_1 elif y <= 9.5e-41: tmp = (t - a) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(1.0 / Float64(1.0 / x)) tmp = 0.0 if (y <= -1.05e+19) tmp = t_1; elseif (y <= 9.5e-41) tmp = Float64(Float64(t - a) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = 1.0 / (1.0 / x); tmp = 0.0; if (y <= -1.05e+19) tmp = t_1; elseif (y <= 9.5e-41) tmp = (t - a) / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.05e+19], t$95$1, If[LessEqual[y, 9.5e-41], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{1}{\frac{1}{x}}\\
\mathbf{if}\;y \leq -1.05 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-41}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.05e19 or 9.4999999999999997e-41 < y Initial program 66.7%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6466.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.6
Applied rewrites66.6%
Taylor expanded in z around 0
lower-/.f6425.8
Applied rewrites25.8%
if -1.05e19 < y < 9.4999999999999997e-41Initial program 66.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6435.1
Applied rewrites35.1%
(FPCore (x y z t a b) :precision binary64 (/ (- t a) b))
double code(double x, double y, double z, double t, double a, double b) {
return (t - a) / b;
}
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 = (t - a) / b
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (t - a) / b;
}
def code(x, y, z, t, a, b): return (t - a) / b
function code(x, y, z, t, a, b) return Float64(Float64(t - a) / b) end
function tmp = code(x, y, z, t, a, b) tmp = (t - a) / b; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]
\frac{t - a}{b}
Initial program 66.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6435.1
Applied rewrites35.1%
(FPCore (x y z t a b) :precision binary64 (/ t b))
double code(double x, double y, double z, double t, double a, double b) {
return t / b;
}
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 = t / b
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return t / b;
}
def code(x, y, z, t, a, b): return t / b
function code(x, y, z, t, a, b) return Float64(t / b) end
function tmp = code(x, y, z, t, a, b) tmp = t / b; end
code[x_, y_, z_, t_, a_, b_] := N[(t / b), $MachinePrecision]
\frac{t}{b}
Initial program 66.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6435.1
Applied rewrites35.1%
Taylor expanded in t around inf
lower-/.f6420.0
Applied rewrites20.0%
herbie shell --seed 2025170
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))