
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ y z) (/ t (- 1.0 z)))))
(if (<= t_1 -2e+289)
(* (/ 1.0 (* (- 1.0 z) z)) (* x (fma (- 1.0 z) y (* (- z) t))))
(if (<= t_1 1e+299) (* x t_1) (/ (* x y) z)))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= -2e+289) {
tmp = (1.0 / ((1.0 - z) * z)) * (x * fma((1.0 - z), y, (-z * t)));
} else if (t_1 <= 1e+299) {
tmp = x * t_1;
} else {
tmp = (x * y) / z;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))) tmp = 0.0 if (t_1 <= -2e+289) tmp = Float64(Float64(1.0 / Float64(Float64(1.0 - z) * z)) * Float64(x * fma(Float64(1.0 - z), y, Float64(Float64(-z) * t)))); elseif (t_1 <= 1e+299) tmp = Float64(x * t_1); else tmp = Float64(Float64(x * y) / z); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+289], N[(N[(1.0 / N[(N[(1.0 - z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[(x * N[(N[(1.0 - z), $MachinePrecision] * y + N[((-z) * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+299], N[(x * t$95$1), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+289}:\\
\;\;\;\;\frac{1}{\left(1 - z\right) \cdot z} \cdot \left(x \cdot \mathsf{fma}\left(1 - z, y, \left(-z\right) \cdot t\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+299}:\\
\;\;\;\;x \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -2.0000000000000001e289Initial program 73.8%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
lower-*.f64N/A
cancel-sign-sub-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
if -2.0000000000000001e289 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 1.0000000000000001e299Initial program 98.8%
if 1.0000000000000001e299 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 77.0%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ y z) (/ t (- 1.0 z)))))
(if (<= t_1 (- INFINITY))
(* (/ x z) y)
(if (<= t_1 1e+299) (* x t_1) (/ (* x y) z)))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x / z) * y;
} else if (t_1 <= 1e+299) {
tmp = x * t_1;
} else {
tmp = (x * y) / z;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (x / z) * y;
} else if (t_1 <= 1e+299) {
tmp = x * t_1;
} else {
tmp = (x * y) / z;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) - (t / (1.0 - z)) tmp = 0 if t_1 <= -math.inf: tmp = (x / z) * y elif t_1 <= 1e+299: tmp = x * t_1 else: tmp = (x * y) / z return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x / z) * y); elseif (t_1 <= 1e+299) tmp = Float64(x * t_1); else tmp = Float64(Float64(x * y) / z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) - (t / (1.0 - z)); tmp = 0.0; if (t_1 <= -Inf) tmp = (x / z) * y; elseif (t_1 <= 1e+299) tmp = x * t_1; else tmp = (x * y) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 1e+299], N[(x * t$95$1), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\mathbf{elif}\;t\_1 \leq 10^{+299}:\\
\;\;\;\;x \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0Initial program 68.6%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.8
Applied rewrites99.8%
Applied rewrites99.9%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 1.0000000000000001e299Initial program 98.8%
if 1.0000000000000001e299 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 77.0%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ (+ t y) z) x)))
(if (<= z -63000.0)
t_1
(if (<= z 1.0) (/ (fma (* x t) (- z) (* x y)) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((t + y) / z) * x;
double tmp;
if (z <= -63000.0) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = fma((x * t), -z, (x * y)) / z;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(Float64(t + y) / z) * x) tmp = 0.0 if (z <= -63000.0) tmp = t_1; elseif (z <= 1.0) tmp = Float64(fma(Float64(x * t), Float64(-z), Float64(x * y)) / z); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -63000.0], t$95$1, If[LessEqual[z, 1.0], N[(N[(N[(x * t), $MachinePrecision] * (-z) + N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t + y}{z} \cdot x\\
\mathbf{if}\;z \leq -63000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{\mathsf{fma}\left(x \cdot t, -z, x \cdot y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -63000 or 1 < z Initial program 98.2%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6497.7
Applied rewrites97.7%
if -63000 < z < 1Initial program 91.5%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6493.5
Applied rewrites93.5%
Taylor expanded in z around 0
Applied rewrites93.2%
Final simplification95.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ (+ t y) z) x)))
(if (<= z -3.7e-6)
t_1
(if (<= z -1.5e-52)
(/ (* x t) (- z 1.0))
(if (<= z 1.0) (/ (* x y) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = ((t + y) / z) * x;
double tmp;
if (z <= -3.7e-6) {
tmp = t_1;
} else if (z <= -1.5e-52) {
tmp = (x * t) / (z - 1.0);
} else if (z <= 1.0) {
tmp = (x * y) / z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = ((t + y) / z) * x
if (z <= (-3.7d-6)) then
tmp = t_1
else if (z <= (-1.5d-52)) then
tmp = (x * t) / (z - 1.0d0)
else if (z <= 1.0d0) then
tmp = (x * y) / z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = ((t + y) / z) * x;
double tmp;
if (z <= -3.7e-6) {
tmp = t_1;
} else if (z <= -1.5e-52) {
tmp = (x * t) / (z - 1.0);
} else if (z <= 1.0) {
tmp = (x * y) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((t + y) / z) * x tmp = 0 if z <= -3.7e-6: tmp = t_1 elif z <= -1.5e-52: tmp = (x * t) / (z - 1.0) elif z <= 1.0: tmp = (x * y) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(t + y) / z) * x) tmp = 0.0 if (z <= -3.7e-6) tmp = t_1; elseif (z <= -1.5e-52) tmp = Float64(Float64(x * t) / Float64(z - 1.0)); elseif (z <= 1.0) tmp = Float64(Float64(x * y) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((t + y) / z) * x; tmp = 0.0; if (z <= -3.7e-6) tmp = t_1; elseif (z <= -1.5e-52) tmp = (x * t) / (z - 1.0); elseif (z <= 1.0) tmp = (x * y) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -3.7e-6], t$95$1, If[LessEqual[z, -1.5e-52], N[(N[(x * t), $MachinePrecision] / N[(z - 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t + y}{z} \cdot x\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-52}:\\
\;\;\;\;\frac{x \cdot t}{z - 1}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.7000000000000002e-6 or 1 < z Initial program 98.2%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6497.8
Applied rewrites97.8%
if -3.7000000000000002e-6 < z < -1.5e-52Initial program 89.1%
Taylor expanded in t around inf
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
lower--.f6485.4
Applied rewrites85.4%
if -1.5e-52 < z < 1Initial program 91.5%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6474.3
Applied rewrites74.3%
Final simplification86.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x (- z 1.0)) t)))
(if (<= t -4.5e+61)
t_1
(if (<= t 1.6e-248)
(* (/ y z) x)
(if (<= t 7.2e+77) (/ (* x y) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / (z - 1.0)) * t;
double tmp;
if (t <= -4.5e+61) {
tmp = t_1;
} else if (t <= 1.6e-248) {
tmp = (y / z) * x;
} else if (t <= 7.2e+77) {
tmp = (x * y) / z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / (z - 1.0d0)) * t
if (t <= (-4.5d+61)) then
tmp = t_1
else if (t <= 1.6d-248) then
tmp = (y / z) * x
else if (t <= 7.2d+77) then
tmp = (x * y) / z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / (z - 1.0)) * t;
double tmp;
if (t <= -4.5e+61) {
tmp = t_1;
} else if (t <= 1.6e-248) {
tmp = (y / z) * x;
} else if (t <= 7.2e+77) {
tmp = (x * y) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / (z - 1.0)) * t tmp = 0 if t <= -4.5e+61: tmp = t_1 elif t <= 1.6e-248: tmp = (y / z) * x elif t <= 7.2e+77: tmp = (x * y) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / Float64(z - 1.0)) * t) tmp = 0.0 if (t <= -4.5e+61) tmp = t_1; elseif (t <= 1.6e-248) tmp = Float64(Float64(y / z) * x); elseif (t <= 7.2e+77) tmp = Float64(Float64(x * y) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / (z - 1.0)) * t; tmp = 0.0; if (t <= -4.5e+61) tmp = t_1; elseif (t <= 1.6e-248) tmp = (y / z) * x; elseif (t <= 7.2e+77) tmp = (x * y) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -4.5e+61], t$95$1, If[LessEqual[t, 1.6e-248], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 7.2e+77], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z - 1} \cdot t\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{-248}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+77}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.5e61 or 7.1999999999999996e77 < t Initial program 97.1%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
lower-*.f64N/A
cancel-sign-sub-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6466.2
Applied rewrites66.2%
Taylor expanded in t around inf
*-commutativeN/A
+-commutativeN/A
remove-double-negN/A
mul-1-negN/A
distribute-frac-negN/A
associate-*r/N/A
mul-1-negN/A
distribute-neg-inN/A
lower-*.f64N/A
Applied rewrites90.6%
Taylor expanded in t around inf
mul-1-negN/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
distribute-neg-frac2N/A
remove-double-negN/A
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6473.3
Applied rewrites73.3%
if -4.5e61 < t < 1.60000000000000009e-248Initial program 93.9%
Taylor expanded in t around 0
lower-/.f6484.8
Applied rewrites84.8%
if 1.60000000000000009e-248 < t < 7.1999999999999996e77Initial program 92.8%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6476.2
Applied rewrites76.2%
Final simplification77.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x t) (- z 1.0))))
(if (<= t -4.5e+61)
t_1
(if (<= t 1.6e-248)
(* (/ y z) x)
(if (<= t 7.8e+77) (/ (* x y) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * t) / (z - 1.0);
double tmp;
if (t <= -4.5e+61) {
tmp = t_1;
} else if (t <= 1.6e-248) {
tmp = (y / z) * x;
} else if (t <= 7.8e+77) {
tmp = (x * y) / z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x * t) / (z - 1.0d0)
if (t <= (-4.5d+61)) then
tmp = t_1
else if (t <= 1.6d-248) then
tmp = (y / z) * x
else if (t <= 7.8d+77) then
tmp = (x * y) / z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * t) / (z - 1.0);
double tmp;
if (t <= -4.5e+61) {
tmp = t_1;
} else if (t <= 1.6e-248) {
tmp = (y / z) * x;
} else if (t <= 7.8e+77) {
tmp = (x * y) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * t) / (z - 1.0) tmp = 0 if t <= -4.5e+61: tmp = t_1 elif t <= 1.6e-248: tmp = (y / z) * x elif t <= 7.8e+77: tmp = (x * y) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * t) / Float64(z - 1.0)) tmp = 0.0 if (t <= -4.5e+61) tmp = t_1; elseif (t <= 1.6e-248) tmp = Float64(Float64(y / z) * x); elseif (t <= 7.8e+77) tmp = Float64(Float64(x * y) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * t) / (z - 1.0); tmp = 0.0; if (t <= -4.5e+61) tmp = t_1; elseif (t <= 1.6e-248) tmp = (y / z) * x; elseif (t <= 7.8e+77) tmp = (x * y) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * t), $MachinePrecision] / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.5e+61], t$95$1, If[LessEqual[t, 1.6e-248], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 7.8e+77], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot t}{z - 1}\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{-248}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{+77}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.5e61 or 7.7999999999999995e77 < t Initial program 97.1%
Taylor expanded in t around inf
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
lower--.f6471.4
Applied rewrites71.4%
if -4.5e61 < t < 1.60000000000000009e-248Initial program 93.9%
Taylor expanded in t around 0
lower-/.f6484.8
Applied rewrites84.8%
if 1.60000000000000009e-248 < t < 7.7999999999999995e77Initial program 92.8%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6476.2
Applied rewrites76.2%
Final simplification77.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ (+ t y) z) x))) (if (<= z -63000.0) t_1 (if (<= z 1.0) (* (- (/ y z) (fma t z t)) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((t + y) / z) * x;
double tmp;
if (z <= -63000.0) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = ((y / z) - fma(t, z, t)) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(Float64(t + y) / z) * x) tmp = 0.0 if (z <= -63000.0) tmp = t_1; elseif (z <= 1.0) tmp = Float64(Float64(Float64(y / z) - fma(t, z, t)) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -63000.0], t$95$1, If[LessEqual[z, 1.0], N[(N[(N[(y / z), $MachinePrecision] - N[(t * z + t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t + y}{z} \cdot x\\
\mathbf{if}\;z \leq -63000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\left(\frac{y}{z} - \mathsf{fma}\left(t, z, t\right)\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -63000 or 1 < z Initial program 98.2%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6497.7
Applied rewrites97.7%
if -63000 < z < 1Initial program 91.5%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6490.8
Applied rewrites90.8%
Final simplification94.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ (+ t y) z) x))) (if (<= z -63000.0) t_1 (if (<= z 1.0) (* (/ (fma (- z) t y) z) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((t + y) / z) * x;
double tmp;
if (z <= -63000.0) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = (fma(-z, t, y) / z) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(Float64(t + y) / z) * x) tmp = 0.0 if (z <= -63000.0) tmp = t_1; elseif (z <= 1.0) tmp = Float64(Float64(fma(Float64(-z), t, y) / z) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -63000.0], t$95$1, If[LessEqual[z, 1.0], N[(N[(N[((-z) * t + y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t + y}{z} \cdot x\\
\mathbf{if}\;z \leq -63000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{\mathsf{fma}\left(-z, t, y\right)}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -63000 or 1 < z Initial program 98.2%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6497.7
Applied rewrites97.7%
if -63000 < z < 1Initial program 91.5%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6452.2
Applied rewrites52.2%
Taylor expanded in z around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6490.5
Applied rewrites90.5%
Final simplification94.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ (+ t y) z) x))) (if (<= z -63000.0) t_1 (if (<= z 1.0) (* (/ (- y (* t z)) z) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((t + y) / z) * x;
double tmp;
if (z <= -63000.0) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = ((y - (t * z)) / z) * x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = ((t + y) / z) * x
if (z <= (-63000.0d0)) then
tmp = t_1
else if (z <= 1.0d0) then
tmp = ((y - (t * z)) / z) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = ((t + y) / z) * x;
double tmp;
if (z <= -63000.0) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = ((y - (t * z)) / z) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((t + y) / z) * x tmp = 0 if z <= -63000.0: tmp = t_1 elif z <= 1.0: tmp = ((y - (t * z)) / z) * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(t + y) / z) * x) tmp = 0.0 if (z <= -63000.0) tmp = t_1; elseif (z <= 1.0) tmp = Float64(Float64(Float64(y - Float64(t * z)) / z) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((t + y) / z) * x; tmp = 0.0; if (z <= -63000.0) tmp = t_1; elseif (z <= 1.0) tmp = ((y - (t * z)) / z) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -63000.0], t$95$1, If[LessEqual[z, 1.0], N[(N[(N[(y - N[(t * z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t + y}{z} \cdot x\\
\mathbf{if}\;z \leq -63000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{y - t \cdot z}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -63000 or 1 < z Initial program 98.2%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6497.7
Applied rewrites97.7%
if -63000 < z < 1Initial program 91.5%
Taylor expanded in z around 0
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f6490.4
Applied rewrites90.4%
Final simplification94.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ t z) x)))
(if (<= t -4.9e+61)
t_1
(if (<= t 1.6e-248)
(* (/ y z) x)
(if (<= t 1.26e+102) (/ (* x y) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (t / z) * x;
double tmp;
if (t <= -4.9e+61) {
tmp = t_1;
} else if (t <= 1.6e-248) {
tmp = (y / z) * x;
} else if (t <= 1.26e+102) {
tmp = (x * y) / z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (t / z) * x
if (t <= (-4.9d+61)) then
tmp = t_1
else if (t <= 1.6d-248) then
tmp = (y / z) * x
else if (t <= 1.26d+102) then
tmp = (x * y) / z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (t / z) * x;
double tmp;
if (t <= -4.9e+61) {
tmp = t_1;
} else if (t <= 1.6e-248) {
tmp = (y / z) * x;
} else if (t <= 1.26e+102) {
tmp = (x * y) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (t / z) * x tmp = 0 if t <= -4.9e+61: tmp = t_1 elif t <= 1.6e-248: tmp = (y / z) * x elif t <= 1.26e+102: tmp = (x * y) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t / z) * x) tmp = 0.0 if (t <= -4.9e+61) tmp = t_1; elseif (t <= 1.6e-248) tmp = Float64(Float64(y / z) * x); elseif (t <= 1.26e+102) tmp = Float64(Float64(x * y) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t / z) * x; tmp = 0.0; if (t <= -4.9e+61) tmp = t_1; elseif (t <= 1.6e-248) tmp = (y / z) * x; elseif (t <= 1.26e+102) tmp = (x * y) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -4.9e+61], t$95$1, If[LessEqual[t, 1.6e-248], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 1.26e+102], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{z} \cdot x\\
\mathbf{if}\;t \leq -4.9 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{-248}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 1.26 \cdot 10^{+102}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.90000000000000025e61 or 1.26000000000000001e102 < t Initial program 97.0%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6468.1
Applied rewrites68.1%
Taylor expanded in t around inf
Applied rewrites56.1%
if -4.90000000000000025e61 < t < 1.60000000000000009e-248Initial program 93.9%
Taylor expanded in t around 0
lower-/.f6484.8
Applied rewrites84.8%
if 1.60000000000000009e-248 < t < 1.26000000000000001e102Initial program 93.1%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6474.5
Applied rewrites74.5%
Final simplification70.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ t z) x)))
(if (<= t -2.5e+63)
t_1
(if (<= t 1.02e-252)
(* (/ x z) y)
(if (<= t 1.26e+102) (/ (* x y) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (t / z) * x;
double tmp;
if (t <= -2.5e+63) {
tmp = t_1;
} else if (t <= 1.02e-252) {
tmp = (x / z) * y;
} else if (t <= 1.26e+102) {
tmp = (x * y) / z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (t / z) * x
if (t <= (-2.5d+63)) then
tmp = t_1
else if (t <= 1.02d-252) then
tmp = (x / z) * y
else if (t <= 1.26d+102) then
tmp = (x * y) / z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (t / z) * x;
double tmp;
if (t <= -2.5e+63) {
tmp = t_1;
} else if (t <= 1.02e-252) {
tmp = (x / z) * y;
} else if (t <= 1.26e+102) {
tmp = (x * y) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (t / z) * x tmp = 0 if t <= -2.5e+63: tmp = t_1 elif t <= 1.02e-252: tmp = (x / z) * y elif t <= 1.26e+102: tmp = (x * y) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t / z) * x) tmp = 0.0 if (t <= -2.5e+63) tmp = t_1; elseif (t <= 1.02e-252) tmp = Float64(Float64(x / z) * y); elseif (t <= 1.26e+102) tmp = Float64(Float64(x * y) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t / z) * x; tmp = 0.0; if (t <= -2.5e+63) tmp = t_1; elseif (t <= 1.02e-252) tmp = (x / z) * y; elseif (t <= 1.26e+102) tmp = (x * y) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -2.5e+63], t$95$1, If[LessEqual[t, 1.02e-252], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 1.26e+102], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{z} \cdot x\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{-252}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\mathbf{elif}\;t \leq 1.26 \cdot 10^{+102}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.50000000000000005e63 or 1.26000000000000001e102 < t Initial program 97.0%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
lower-+.f6467.8
Applied rewrites67.8%
Taylor expanded in t around inf
Applied rewrites55.7%
if -2.50000000000000005e63 < t < 1.02000000000000002e-252Initial program 93.9%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6477.5
Applied rewrites77.5%
Applied rewrites84.2%
if 1.02000000000000002e-252 < t < 1.26000000000000001e102Initial program 93.2%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6474.8
Applied rewrites74.8%
Final simplification70.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x z) t)))
(if (<= t -2.5e+63)
t_1
(if (<= t 1.02e-252)
(* (/ x z) y)
(if (<= t 5.5e+153) (/ (* x y) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / z) * t;
double tmp;
if (t <= -2.5e+63) {
tmp = t_1;
} else if (t <= 1.02e-252) {
tmp = (x / z) * y;
} else if (t <= 5.5e+153) {
tmp = (x * y) / z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) * t
if (t <= (-2.5d+63)) then
tmp = t_1
else if (t <= 1.02d-252) then
tmp = (x / z) * y
else if (t <= 5.5d+153) then
tmp = (x * y) / z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) * t;
double tmp;
if (t <= -2.5e+63) {
tmp = t_1;
} else if (t <= 1.02e-252) {
tmp = (x / z) * y;
} else if (t <= 5.5e+153) {
tmp = (x * y) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) * t tmp = 0 if t <= -2.5e+63: tmp = t_1 elif t <= 1.02e-252: tmp = (x / z) * y elif t <= 5.5e+153: tmp = (x * y) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / z) * t) tmp = 0.0 if (t <= -2.5e+63) tmp = t_1; elseif (t <= 1.02e-252) tmp = Float64(Float64(x / z) * y); elseif (t <= 5.5e+153) tmp = Float64(Float64(x * y) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / z) * t; tmp = 0.0; if (t <= -2.5e+63) tmp = t_1; elseif (t <= 1.02e-252) tmp = (x / z) * y; elseif (t <= 5.5e+153) tmp = (x * y) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2.5e+63], t$95$1, If[LessEqual[t, 1.02e-252], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 5.5e+153], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot t\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{-252}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.50000000000000005e63 or 5.5000000000000003e153 < t Initial program 97.8%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
lower-*.f64N/A
cancel-sign-sub-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6465.4
Applied rewrites65.4%
Taylor expanded in t around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
distribute-lft-inN/A
metadata-evalN/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
lower-+.f6469.7
Applied rewrites69.7%
Taylor expanded in z around inf
Applied rewrites51.1%
if -2.50000000000000005e63 < t < 1.02000000000000002e-252Initial program 93.9%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6477.5
Applied rewrites77.5%
Applied rewrites84.2%
if 1.02000000000000002e-252 < t < 5.5000000000000003e153Initial program 92.7%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6470.4
Applied rewrites70.4%
Final simplification68.1%
(FPCore (x y z t) :precision binary64 (if (<= y -2e-156) (/ (* x y) z) (if (<= y 3.9e-14) (* (- x) t) (* (/ x z) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2e-156) {
tmp = (x * y) / z;
} else if (y <= 3.9e-14) {
tmp = -x * t;
} else {
tmp = (x / z) * y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2d-156)) then
tmp = (x * y) / z
else if (y <= 3.9d-14) then
tmp = -x * t
else
tmp = (x / z) * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2e-156) {
tmp = (x * y) / z;
} else if (y <= 3.9e-14) {
tmp = -x * t;
} else {
tmp = (x / z) * y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2e-156: tmp = (x * y) / z elif y <= 3.9e-14: tmp = -x * t else: tmp = (x / z) * y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2e-156) tmp = Float64(Float64(x * y) / z); elseif (y <= 3.9e-14) tmp = Float64(Float64(-x) * t); else tmp = Float64(Float64(x / z) * y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2e-156) tmp = (x * y) / z; elseif (y <= 3.9e-14) tmp = -x * t; else tmp = (x / z) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2e-156], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 3.9e-14], N[((-x) * t), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-156}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-14}:\\
\;\;\;\;\left(-x\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\end{array}
\end{array}
if y < -2.00000000000000008e-156Initial program 94.5%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6467.7
Applied rewrites67.7%
if -2.00000000000000008e-156 < y < 3.8999999999999998e-14Initial program 98.5%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
lower-*.f64N/A
cancel-sign-sub-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6473.3
Applied rewrites73.3%
Taylor expanded in t around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
distribute-lft-inN/A
metadata-evalN/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
lower-+.f6476.8
Applied rewrites76.8%
Taylor expanded in z around 0
Applied rewrites50.4%
if 3.8999999999999998e-14 < y Initial program 92.0%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6472.2
Applied rewrites72.2%
Applied rewrites74.7%
Final simplification64.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ x z) y))) (if (<= y -3.8e-151) t_1 (if (<= y 3.9e-14) (* (- x) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / z) * y;
double tmp;
if (y <= -3.8e-151) {
tmp = t_1;
} else if (y <= 3.9e-14) {
tmp = -x * t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) * y
if (y <= (-3.8d-151)) then
tmp = t_1
else if (y <= 3.9d-14) then
tmp = -x * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) * y;
double tmp;
if (y <= -3.8e-151) {
tmp = t_1;
} else if (y <= 3.9e-14) {
tmp = -x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) * y tmp = 0 if y <= -3.8e-151: tmp = t_1 elif y <= 3.9e-14: tmp = -x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / z) * y) tmp = 0.0 if (y <= -3.8e-151) tmp = t_1; elseif (y <= 3.9e-14) tmp = Float64(Float64(-x) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / z) * y; tmp = 0.0; if (y <= -3.8e-151) tmp = t_1; elseif (y <= 3.9e-14) tmp = -x * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -3.8e-151], t$95$1, If[LessEqual[y, 3.9e-14], N[((-x) * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot y\\
\mathbf{if}\;y \leq -3.8 \cdot 10^{-151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-14}:\\
\;\;\;\;\left(-x\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.7999999999999997e-151 or 3.8999999999999998e-14 < y Initial program 93.5%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6469.5
Applied rewrites69.5%
Applied rewrites69.2%
if -3.7999999999999997e-151 < y < 3.8999999999999998e-14Initial program 98.5%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
lower-*.f64N/A
cancel-sign-sub-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6473.3
Applied rewrites73.3%
Taylor expanded in t around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
distribute-lft-inN/A
metadata-evalN/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
lower-+.f6476.8
Applied rewrites76.8%
Taylor expanded in z around 0
Applied rewrites50.4%
(FPCore (x y z t) :precision binary64 (* (- x) t))
double code(double x, double y, double z, double t) {
return -x * t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -x * t
end function
public static double code(double x, double y, double z, double t) {
return -x * t;
}
def code(x, y, z, t): return -x * t
function code(x, y, z, t) return Float64(Float64(-x) * t) end
function tmp = code(x, y, z, t) tmp = -x * t; end
code[x_, y_, z_, t_] := N[((-x) * t), $MachinePrecision]
\begin{array}{l}
\\
\left(-x\right) \cdot t
\end{array}
Initial program 94.9%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
lower-*.f64N/A
cancel-sign-sub-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6469.1
Applied rewrites69.1%
Taylor expanded in t around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
distribute-lft-inN/A
metadata-evalN/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
lower-+.f6446.6
Applied rewrites46.6%
Taylor expanded in z around 0
Applied rewrites25.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))))
(t_2 (* x (- (/ y z) (/ t (- 1.0 z))))))
(if (< t_2 -7.623226303312042e-196)
t_1
(if (< t_2 1.4133944927702302e-211)
(+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z))))
t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 < -7.623226303312042e-196) {
tmp = t_1;
} else if (t_2 < 1.4133944927702302e-211) {
tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * ((y / z) - (t * (1.0d0 / (1.0d0 - z))))
t_2 = x * ((y / z) - (t / (1.0d0 - z)))
if (t_2 < (-7.623226303312042d-196)) then
tmp = t_1
else if (t_2 < 1.4133944927702302d-211) then
tmp = ((y * x) / z) + -((t * x) / (1.0d0 - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 < -7.623226303312042e-196) {
tmp = t_1;
} else if (t_2 < 1.4133944927702302e-211) {
tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z)))) t_2 = x * ((y / z) - (t / (1.0 - z))) tmp = 0 if t_2 < -7.623226303312042e-196: tmp = t_1 elif t_2 < 1.4133944927702302e-211: tmp = ((y * x) / z) + -((t * x) / (1.0 - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - Float64(t * Float64(1.0 / Float64(1.0 - z))))) t_2 = Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) tmp = 0.0 if (t_2 < -7.623226303312042e-196) tmp = t_1; elseif (t_2 < 1.4133944927702302e-211) tmp = Float64(Float64(Float64(y * x) / z) + Float64(-Float64(Float64(t * x) / Float64(1.0 - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z)))); t_2 = x * ((y / z) - (t / (1.0 - z))); tmp = 0.0; if (t_2 < -7.623226303312042e-196) tmp = t_1; elseif (t_2 < 1.4133944927702302e-211) tmp = ((y * x) / z) + -((t * x) / (1.0 - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t * N[(1.0 / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -7.623226303312042e-196], t$95$1, If[Less[t$95$2, 1.4133944927702302e-211], N[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] + (-N[(N[(t * x), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\
t_2 := x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\
\mathbf{if}\;t\_2 < -7.623226303312042 \cdot 10^{-196}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 < 1.4133944927702302 \cdot 10^{-211}:\\
\;\;\;\;\frac{y \cdot x}{z} + \left(-\frac{t \cdot x}{1 - z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024235
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:alt
(! :herbie-platform default (if (< (* x (- (/ y z) (/ t (- 1 z)))) -3811613151656021/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* x (- (/ y z) (* t (/ 1 (- 1 z))))) (if (< (* x (- (/ y z) (/ t (- 1 z)))) 7066972463851151/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (/ (* y x) z) (- (/ (* t x) (- 1 z)))) (* x (- (/ y z) (* t (/ 1 (- 1 z))))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))