
(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]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
Herbie found 15 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]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2
(-
(fma (/ x z) (/ y (- b y)) (/ t (- b y)))
(fma (/ y z) (/ (- t a) (pow (- b y) 2.0)) (/ a (- b y)))))
(t_3 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_4 (* x (/ y t_1))))
(if (<= t_3 -1e-289)
(fma z (/ (- t a) (fma b z (* y (+ 1.0 (* -1.0 z))))) t_4)
(if (<= t_3 1e-253)
t_2
(if (<= t_3 INFINITY) (fma z (/ (- t a) t_1) t_4) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((b - y), z, y);
double t_2 = fma((x / z), (y / (b - y)), (t / (b - y))) - fma((y / z), ((t - a) / pow((b - y), 2.0)), (a / (b - y)));
double t_3 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_4 = x * (y / t_1);
double tmp;
if (t_3 <= -1e-289) {
tmp = fma(z, ((t - a) / fma(b, z, (y * (1.0 + (-1.0 * z))))), t_4);
} else if (t_3 <= 1e-253) {
tmp = t_2;
} else if (t_3 <= ((double) INFINITY)) {
tmp = fma(z, ((t - a) / t_1), t_4);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(fma(Float64(x / z), Float64(y / Float64(b - y)), Float64(t / Float64(b - y))) - fma(Float64(y / z), Float64(Float64(t - a) / (Float64(b - y) ^ 2.0)), Float64(a / Float64(b - y)))) t_3 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_4 = Float64(x * Float64(y / t_1)) tmp = 0.0 if (t_3 <= -1e-289) tmp = fma(z, Float64(Float64(t - a) / fma(b, z, Float64(y * Float64(1.0 + Float64(-1.0 * z))))), t_4); elseif (t_3 <= 1e-253) tmp = t_2; elseif (t_3 <= Inf) tmp = fma(z, Float64(Float64(t - a) / t_1), t_4); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y / z), $MachinePrecision] * N[(N[(t - a), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[(a / N[(b - y), $MachinePrecision]), $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]}, Block[{t$95$4 = N[(x * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e-289], N[(z * N[(N[(t - a), $MachinePrecision] / N[(b * z + N[(y * N[(1.0 + N[(-1.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision], If[LessEqual[t$95$3, 1e-253], t$95$2, If[LessEqual[t$95$3, Infinity], N[(z * N[(N[(t - a), $MachinePrecision] / t$95$1), $MachinePrecision] + t$95$4), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \mathsf{fma}\left(\frac{x}{z}, \frac{y}{b - y}, \frac{t}{b - y}\right) - \mathsf{fma}\left(\frac{y}{z}, \frac{t - a}{{\left(b - y\right)}^{2}}, \frac{a}{b - y}\right)\\
t_3 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_4 := x \cdot \frac{y}{t\_1}\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{-289}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b, z, y \cdot \left(1 + -1 \cdot z\right)\right)}, t\_4\right)\\
\mathbf{elif}\;t\_3 \leq 10^{-253}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{t\_1}, t\_4\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1e-289Initial program 82.0%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
div-add-revN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites92.3%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6492.3
Applied rewrites92.3%
if -1e-289 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.0000000000000001e-253 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 14.5%
Taylor expanded in z around inf
lower--.f64N/A
+-commutativeN/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
+-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites96.2%
if 1.0000000000000001e-253 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 82.5%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
div-add-revN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites92.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (/ (fma y x (* (- t a) z)) t_1))
(t_3 (/ (- t a) (- b y)))
(t_4 (/ (+ (* x y) (* z (- t a))) t_1))
(t_5 (fma z (/ (- t a) (fma (- b y) z y)) (* x (/ -1.0 (- z 1.0))))))
(if (<= t_4 (- INFINITY))
t_5
(if (<= t_4 -5e-295)
t_2
(if (<= t_4 0.0)
t_3
(if (<= t_4 4e+286) t_2 (if (<= t_4 INFINITY) t_5 t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = fma(y, x, ((t - a) * z)) / t_1;
double t_3 = (t - a) / (b - y);
double t_4 = ((x * y) + (z * (t - a))) / t_1;
double t_5 = fma(z, ((t - a) / fma((b - y), z, y)), (x * (-1.0 / (z - 1.0))));
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_4 <= -5e-295) {
tmp = t_2;
} else if (t_4 <= 0.0) {
tmp = t_3;
} else if (t_4 <= 4e+286) {
tmp = t_2;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_5;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(fma(y, x, Float64(Float64(t - a) * z)) / t_1) t_3 = Float64(Float64(t - a) / Float64(b - y)) t_4 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / t_1) t_5 = fma(z, Float64(Float64(t - a) / fma(Float64(b - y), z, y)), Float64(x * Float64(-1.0 / Float64(z - 1.0)))) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_5; elseif (t_4 <= -5e-295) tmp = t_2; elseif (t_4 <= 0.0) tmp = t_3; elseif (t_4 <= 4e+286) tmp = t_2; elseif (t_4 <= Inf) tmp = t_5; else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * x + N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(z * N[(N[(t - a), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(-1.0 / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$5, If[LessEqual[t$95$4, -5e-295], t$95$2, If[LessEqual[t$95$4, 0.0], t$95$3, If[LessEqual[t$95$4, 4e+286], t$95$2, If[LessEqual[t$95$4, Infinity], t$95$5, t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{t\_1}\\
t_3 := \frac{t - a}{b - y}\\
t_4 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_1}\\
t_5 := \mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b - y, z, y\right)}, x \cdot \frac{-1}{z - 1}\right)\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-295}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 4 \cdot 10^{+286}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 4.00000000000000013e286 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 32.5%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
div-add-revN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites98.5%
Taylor expanded in y around -inf
lower-/.f64N/A
lower--.f6494.8
Applied rewrites94.8%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -5.00000000000000008e-295 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 4.00000000000000013e286Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6499.5
Applied rewrites99.5%
if -5.00000000000000008e-295 < (/.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 10.6%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6477.0
Applied rewrites77.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (/ (- t a) (- b y)))
(t_3 (/ (fma y x (* (- t a) z)) t_1))
(t_4 (/ (+ (* x y) (* z (- t a))) t_1))
(t_5 (fma z (/ (- t a) (fma (- b y) z y)) x)))
(if (<= t_4 (- INFINITY))
t_5
(if (<= t_4 -5e-295)
t_3
(if (<= t_4 0.0)
t_2
(if (<= t_4 4e+286) t_3 (if (<= t_4 INFINITY) t_5 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = (t - a) / (b - y);
double t_3 = fma(y, x, ((t - a) * z)) / t_1;
double t_4 = ((x * y) + (z * (t - a))) / t_1;
double t_5 = fma(z, ((t - a) / fma((b - y), z, y)), x);
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_4 <= -5e-295) {
tmp = t_3;
} else if (t_4 <= 0.0) {
tmp = t_2;
} else if (t_4 <= 4e+286) {
tmp = t_3;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_5;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(Float64(t - a) / Float64(b - y)) t_3 = Float64(fma(y, x, Float64(Float64(t - a) * z)) / t_1) t_4 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / t_1) t_5 = fma(z, Float64(Float64(t - a) / fma(Float64(b - y), z, y)), x) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_5; elseif (t_4 <= -5e-295) tmp = t_3; elseif (t_4 <= 0.0) tmp = t_2; elseif (t_4 <= 4e+286) tmp = t_3; elseif (t_4 <= Inf) tmp = t_5; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * x + N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(z * N[(N[(t - a), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$5, If[LessEqual[t$95$4, -5e-295], t$95$3, If[LessEqual[t$95$4, 0.0], t$95$2, If[LessEqual[t$95$4, 4e+286], t$95$3, If[LessEqual[t$95$4, Infinity], t$95$5, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{t - a}{b - y}\\
t_3 := \frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{t\_1}\\
t_4 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_1}\\
t_5 := \mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b - y, z, y\right)}, x\right)\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-295}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq 4 \cdot 10^{+286}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 4.00000000000000013e286 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 32.5%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
div-add-revN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites98.5%
Taylor expanded in z around 0
Applied rewrites82.7%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -5.00000000000000008e-295 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 4.00000000000000013e286Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6499.5
Applied rewrites99.5%
if -5.00000000000000008e-295 < (/.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 10.6%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6477.0
Applied rewrites77.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -8e+45)
t_1
(if (<= z 2.2e+71)
(fma
z
(/ (- t a) (fma b z (* y (+ 1.0 (* -1.0 z)))))
(* x (/ y (fma (- b y) z y))))
(fma
(/
(- (- (* x (/ y (- b y)))) (- (/ (* (- t a) y) (pow (- b y) 2.0))))
z)
-1.0
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 <= -8e+45) {
tmp = t_1;
} else if (z <= 2.2e+71) {
tmp = fma(z, ((t - a) / fma(b, z, (y * (1.0 + (-1.0 * z))))), (x * (y / fma((b - y), z, y))));
} else {
tmp = fma(((-(x * (y / (b - y))) - -(((t - a) * y) / pow((b - y), 2.0))) / z), -1.0, 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 <= -8e+45) tmp = t_1; elseif (z <= 2.2e+71) tmp = fma(z, Float64(Float64(t - a) / fma(b, z, Float64(y * Float64(1.0 + Float64(-1.0 * z))))), Float64(x * Float64(y / fma(Float64(b - y), z, y)))); else tmp = fma(Float64(Float64(Float64(-Float64(x * Float64(y / Float64(b - y)))) - Float64(-Float64(Float64(Float64(t - a) * y) / (Float64(b - y) ^ 2.0)))) / z), -1.0, 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, -8e+45], t$95$1, If[LessEqual[z, 2.2e+71], N[(z * N[(N[(t - a), $MachinePrecision] / N[(b * z + N[(y * N[(1.0 + N[(-1.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[((-N[(x * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) - (-N[(N[(N[(t - a), $MachinePrecision] * y), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision] / z), $MachinePrecision] * -1.0 + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -8 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+71}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b, z, y \cdot \left(1 + -1 \cdot z\right)\right)}, x \cdot \frac{y}{\mathsf{fma}\left(b - y, z, y\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(-x \cdot \frac{y}{b - y}\right) - \left(-\frac{\left(t - a\right) \cdot y}{{\left(b - y\right)}^{2}}\right)}{z}, -1, t\_1\right)\\
\end{array}
\end{array}
if z < -7.9999999999999994e45Initial program 38.1%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6483.4
Applied rewrites83.4%
if -7.9999999999999994e45 < z < 2.19999999999999995e71Initial program 86.6%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
div-add-revN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites90.2%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6490.2
Applied rewrites90.2%
if 2.19999999999999995e71 < z Initial program 35.1%
Taylor expanded in z around -inf
associate--l+N/A
*-commutativeN/A
div-subN/A
lower-fma.f64N/A
Applied rewrites75.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -8e+45)
t_1
(if (<= z 1.5e+183)
(fma
z
(/ (- t a) (fma b z (* y (+ 1.0 (* -1.0 z)))))
(* x (/ y (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 <= -8e+45) {
tmp = t_1;
} else if (z <= 1.5e+183) {
tmp = fma(z, ((t - a) / fma(b, z, (y * (1.0 + (-1.0 * z))))), (x * (y / 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 <= -8e+45) tmp = t_1; elseif (z <= 1.5e+183) tmp = fma(z, Float64(Float64(t - a) / fma(b, z, Float64(y * Float64(1.0 + Float64(-1.0 * z))))), Float64(x * Float64(y / 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, -8e+45], t$95$1, If[LessEqual[z, 1.5e+183], N[(z * N[(N[(t - a), $MachinePrecision] / N[(b * z + N[(y * N[(1.0 + N[(-1.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -8 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+183}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b, z, y \cdot \left(1 + -1 \cdot z\right)\right)}, x \cdot \frac{y}{\mathsf{fma}\left(b - y, z, y\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.9999999999999994e45 or 1.49999999999999998e183 < z Initial program 33.6%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6484.7
Applied rewrites84.7%
if -7.9999999999999994e45 < z < 1.49999999999999998e183Initial program 81.6%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
div-add-revN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites87.2%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6487.2
Applied rewrites87.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -8e+45)
t_2
(if (<= z 1.5e+183) (fma z (/ (- t a) t_1) (* x (/ y t_1))) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((b - y), z, y);
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -8e+45) {
tmp = t_2;
} else if (z <= 1.5e+183) {
tmp = fma(z, ((t - a) / t_1), (x * (y / t_1)));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -8e+45) tmp = t_2; elseif (z <= 1.5e+183) tmp = fma(z, Float64(Float64(t - a) / t_1), Float64(x * Float64(y / t_1))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+45], t$95$2, If[LessEqual[z, 1.5e+183], N[(z * N[(N[(t - a), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(x * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -8 \cdot 10^{+45}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+183}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{t\_1}, x \cdot \frac{y}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -7.9999999999999994e45 or 1.49999999999999998e183 < z Initial program 33.6%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6484.7
Applied rewrites84.7%
if -7.9999999999999994e45 < z < 1.49999999999999998e183Initial program 81.6%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
div-add-revN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites87.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -2.22e+21)
t_1
(if (<= z -85.0)
(/ (- x) (- z 1.0))
(if (<= z 2.5e+41) (/ (fma y x (* (- t a) z)) (+ y (* z b))) 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 <= -2.22e+21) {
tmp = t_1;
} else if (z <= -85.0) {
tmp = -x / (z - 1.0);
} else if (z <= 2.5e+41) {
tmp = fma(y, x, ((t - a) * z)) / (y + (z * b));
} 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 <= -2.22e+21) tmp = t_1; elseif (z <= -85.0) tmp = Float64(Float64(-x) / Float64(z - 1.0)); elseif (z <= 2.5e+41) tmp = Float64(fma(y, x, Float64(Float64(t - a) * z)) / Float64(y + Float64(z * b))); 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, -2.22e+21], t$95$1, If[LessEqual[z, -85.0], N[((-x) / N[(z - 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e+41], N[(N[(y * x + N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.22 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -85:\\
\;\;\;\;\frac{-x}{z - 1}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+41}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{y + z \cdot b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.22e21 or 2.50000000000000011e41 < z Initial program 40.4%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6482.4
Applied rewrites82.4%
if -2.22e21 < z < -85Initial program 86.5%
Taylor expanded in y around -inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f6420.1
Applied rewrites20.1%
if -85 < z < 2.50000000000000011e41Initial program 87.5%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6487.5
Applied rewrites87.5%
Taylor expanded in y around 0
Applied rewrites84.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -9.2e+41)
t_1
(if (<= z 2.25e-14) (fma z (/ (- t a) (fma (- b y) z y)) 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 <= -9.2e+41) {
tmp = t_1;
} else if (z <= 2.25e-14) {
tmp = fma(z, ((t - a) / fma((b - y), z, y)), 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 <= -9.2e+41) tmp = t_1; elseif (z <= 2.25e-14) tmp = fma(z, Float64(Float64(t - a) / fma(Float64(b - y), z, y)), x); 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, -9.2e+41], t$95$1, If[LessEqual[z, 2.25e-14], N[(z * N[(N[(t - a), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -9.2 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b - y, z, y\right)}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.1999999999999994e41 or 2.2499999999999999e-14 < z Initial program 43.4%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6480.5
Applied rewrites80.5%
if -9.1999999999999994e41 < z < 2.2499999999999999e-14Initial program 87.3%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
div-add-revN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites90.2%
Taylor expanded in z around 0
Applied rewrites73.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -3.6e-7) t_1 (if (<= z 1.6e-21) (fma (/ (- t a) y) z 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-7) {
tmp = t_1;
} else if (z <= 1.6e-21) {
tmp = fma(((t - a) / y), z, 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-7) tmp = t_1; elseif (z <= 1.6e-21) tmp = fma(Float64(Float64(t - a) / y), z, x); 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-7], t$95$1, If[LessEqual[z, 1.6e-21], N[(N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-21}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - a}{y}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.59999999999999994e-7 or 1.6000000000000001e-21 < z Initial program 47.2%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6478.9
Applied rewrites78.9%
if -3.59999999999999994e-7 < z < 1.6000000000000001e-21Initial program 87.5%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
div-add-revN/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6451.8
Applied rewrites51.8%
Taylor expanded in x around 0
Applied rewrites65.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -2.1e-10) t_1 (if (<= z 1.6e-21) (fma (/ t y) z 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 <= -2.1e-10) {
tmp = t_1;
} else if (z <= 1.6e-21) {
tmp = fma((t / y), z, 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 <= -2.1e-10) tmp = t_1; elseif (z <= 1.6e-21) tmp = fma(Float64(t / y), z, x); 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, -2.1e-10], t$95$1, If[LessEqual[z, 1.6e-21], N[(N[(t / y), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-21}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{y}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.1e-10 or 1.6000000000000001e-21 < z Initial program 47.4%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6478.7
Applied rewrites78.7%
if -2.1e-10 < z < 1.6000000000000001e-21Initial program 87.6%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
div-add-revN/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6451.9
Applied rewrites51.9%
Taylor expanded in t around inf
Applied rewrites57.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -2.22e+21) t_1 (if (<= z 9.5e-24) (/ (- x) (- z 1.0)) 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 <= -2.22e+21) {
tmp = t_1;
} else if (z <= 9.5e-24) {
tmp = -x / (z - 1.0);
} 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 <= (-2.22d+21)) then
tmp = t_1
else if (z <= 9.5d-24) then
tmp = -x / (z - 1.0d0)
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 <= -2.22e+21) {
tmp = t_1;
} else if (z <= 9.5e-24) {
tmp = -x / (z - 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -2.22e+21: tmp = t_1 elif z <= 9.5e-24: tmp = -x / (z - 1.0) 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 <= -2.22e+21) tmp = t_1; elseif (z <= 9.5e-24) tmp = Float64(Float64(-x) / Float64(z - 1.0)); 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 <= -2.22e+21) tmp = t_1; elseif (z <= 9.5e-24) tmp = -x / (z - 1.0); 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, -2.22e+21], t$95$1, If[LessEqual[z, 9.5e-24], N[((-x) / N[(z - 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.22 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-24}:\\
\;\;\;\;\frac{-x}{z - 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.22e21 or 9.50000000000000029e-24 < z Initial program 45.5%
Taylor expanded in z around inf
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.5
Applied rewrites79.5%
if -2.22e21 < z < 9.50000000000000029e-24Initial program 87.5%
Taylor expanded in y around -inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f6448.1
Applied rewrites48.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- x) (- z 1.0)))) (if (<= y -8e-19) t_1 (if (<= y 3.1e-87) (/ (- t a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -x / (z - 1.0);
double tmp;
if (y <= -8e-19) {
tmp = t_1;
} else if (y <= 3.1e-87) {
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 = -x / (z - 1.0d0)
if (y <= (-8d-19)) then
tmp = t_1
else if (y <= 3.1d-87) 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 = -x / (z - 1.0);
double tmp;
if (y <= -8e-19) {
tmp = t_1;
} else if (y <= 3.1e-87) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -x / (z - 1.0) tmp = 0 if y <= -8e-19: tmp = t_1 elif y <= 3.1e-87: tmp = (t - a) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-x) / Float64(z - 1.0)) tmp = 0.0 if (y <= -8e-19) tmp = t_1; elseif (y <= 3.1e-87) 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 = -x / (z - 1.0); tmp = 0.0; if (y <= -8e-19) tmp = t_1; elseif (y <= 3.1e-87) 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[((-x) / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8e-19], t$95$1, If[LessEqual[y, 3.1e-87], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-x}{z - 1}\\
\mathbf{if}\;y \leq -8 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-87}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.9999999999999998e-19 or 3.09999999999999998e-87 < y Initial program 56.4%
Taylor expanded in y around -inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f6447.9
Applied rewrites47.9%
if -7.9999999999999998e-19 < y < 3.09999999999999998e-87Initial program 80.9%
Taylor expanded in y around 0
lower-/.f64N/A
lift--.f6461.7
Applied rewrites61.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) b))) (if (<= z -2.3e-104) t_1 (if (<= z 9.5e-24) x t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / b;
double tmp;
if (z <= -2.3e-104) {
tmp = t_1;
} else if (z <= 9.5e-24) {
tmp = 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
if (z <= (-2.3d-104)) then
tmp = t_1
else if (z <= 9.5d-24) then
tmp = 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;
double tmp;
if (z <= -2.3e-104) {
tmp = t_1;
} else if (z <= 9.5e-24) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / b tmp = 0 if z <= -2.3e-104: tmp = t_1 elif z <= 9.5e-24: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / b) tmp = 0.0 if (z <= -2.3e-104) tmp = t_1; elseif (z <= 9.5e-24) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / b; tmp = 0.0; if (z <= -2.3e-104) tmp = t_1; elseif (z <= 9.5e-24) tmp = 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] / b), $MachinePrecision]}, If[LessEqual[z, -2.3e-104], t$95$1, If[LessEqual[z, 9.5e-24], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b}\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{-104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-24}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.2999999999999999e-104 or 9.50000000000000029e-24 < z Initial program 52.6%
Taylor expanded in y around 0
lower-/.f64N/A
lift--.f6446.5
Applied rewrites46.5%
if -2.2999999999999999e-104 < z < 9.50000000000000029e-24Initial program 87.5%
Taylor expanded in z around 0
Applied rewrites52.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4e-10) (/ t b) (if (<= z 3.6e-21) x (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4e-10) {
tmp = t / b;
} else if (z <= 3.6e-21) {
tmp = x;
} else {
tmp = t / b;
}
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 <= (-4d-10)) then
tmp = t / b
else if (z <= 3.6d-21) then
tmp = x
else
tmp = t / b
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 <= -4e-10) {
tmp = t / b;
} else if (z <= 3.6e-21) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4e-10: tmp = t / b elif z <= 3.6e-21: tmp = x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4e-10) tmp = Float64(t / b); elseif (z <= 3.6e-21) tmp = x; else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4e-10) tmp = t / b; elseif (z <= 3.6e-21) tmp = x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4e-10], N[(t / b), $MachinePrecision], If[LessEqual[z, 3.6e-21], x, N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-10}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-21}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -4.00000000000000015e-10 or 3.59999999999999989e-21 < z Initial program 47.4%
Taylor expanded in b around inf
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6433.2
Applied rewrites33.2%
Taylor expanded in t around inf
lower-/.f6427.5
Applied rewrites27.5%
if -4.00000000000000015e-10 < z < 3.59999999999999989e-21Initial program 87.5%
Taylor expanded in z around 0
Applied rewrites49.4%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 66.5%
Taylor expanded in z around 0
Applied rewrites25.7%
(FPCore (x y z t a b) :precision binary64 (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
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 = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
def code(x, y, z, t, a, b): return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(z * t) + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))) - Float64(a / Float64(Float64(b - y) + Float64(y / z)))) end
function tmp = code(x, y, z, t, a, b) tmp = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(z * t), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(N[(b - y), $MachinePrecision] + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}
\end{array}
herbie shell --seed 2025105
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))