
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - 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 - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - 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 z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - 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 - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* (/ (pow (cbrt x) 2.0) (- y z)) (/ (cbrt x) (- t z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (pow(cbrt(x), 2.0) / (y - z)) * (cbrt(x) / (t - z));
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (Math.pow(Math.cbrt(x), 2.0) / (y - z)) * (Math.cbrt(x) / (t - z));
}
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64((cbrt(x) ^ 2.0) / Float64(y - z)) * Float64(cbrt(x) / Float64(t - z))) end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[Power[N[Power[x, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{{\left(\sqrt[3]{x}\right)}^{2}}{y - z} \cdot \frac{\sqrt[3]{x}}{t - z}
\end{array}
Initial program 90.5%
add-cube-cbrt89.6%
times-frac95.8%
pow295.8%
Applied egg-rr95.8%
Final simplification95.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x t) y)) (t_2 (/ (- x) z)) (t_3 (/ t_2 z)))
(if (<= z -2.7e+127)
t_3
(if (<= z -13500000.0)
(/ (/ (- x) t) z)
(if (<= z 5.6e+23)
t_1
(if (<= z 4.5e+108) (/ t_2 y) (if (<= z 4.2e+123) t_1 t_3)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / t) / y;
double t_2 = -x / z;
double t_3 = t_2 / z;
double tmp;
if (z <= -2.7e+127) {
tmp = t_3;
} else if (z <= -13500000.0) {
tmp = (-x / t) / z;
} else if (z <= 5.6e+23) {
tmp = t_1;
} else if (z <= 4.5e+108) {
tmp = t_2 / y;
} else if (z <= 4.2e+123) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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) :: t_3
real(8) :: tmp
t_1 = (x / t) / y
t_2 = -x / z
t_3 = t_2 / z
if (z <= (-2.7d+127)) then
tmp = t_3
else if (z <= (-13500000.0d0)) then
tmp = (-x / t) / z
else if (z <= 5.6d+23) then
tmp = t_1
else if (z <= 4.5d+108) then
tmp = t_2 / y
else if (z <= 4.2d+123) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / t) / y;
double t_2 = -x / z;
double t_3 = t_2 / z;
double tmp;
if (z <= -2.7e+127) {
tmp = t_3;
} else if (z <= -13500000.0) {
tmp = (-x / t) / z;
} else if (z <= 5.6e+23) {
tmp = t_1;
} else if (z <= 4.5e+108) {
tmp = t_2 / y;
} else if (z <= 4.2e+123) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (x / t) / y t_2 = -x / z t_3 = t_2 / z tmp = 0 if z <= -2.7e+127: tmp = t_3 elif z <= -13500000.0: tmp = (-x / t) / z elif z <= 5.6e+23: tmp = t_1 elif z <= 4.5e+108: tmp = t_2 / y elif z <= 4.2e+123: tmp = t_1 else: tmp = t_3 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / t) / y) t_2 = Float64(Float64(-x) / z) t_3 = Float64(t_2 / z) tmp = 0.0 if (z <= -2.7e+127) tmp = t_3; elseif (z <= -13500000.0) tmp = Float64(Float64(Float64(-x) / t) / z); elseif (z <= 5.6e+23) tmp = t_1; elseif (z <= 4.5e+108) tmp = Float64(t_2 / y); elseif (z <= 4.2e+123) tmp = t_1; else tmp = t_3; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / t) / y;
t_2 = -x / z;
t_3 = t_2 / z;
tmp = 0.0;
if (z <= -2.7e+127)
tmp = t_3;
elseif (z <= -13500000.0)
tmp = (-x / t) / z;
elseif (z <= 5.6e+23)
tmp = t_1;
elseif (z <= 4.5e+108)
tmp = t_2 / y;
elseif (z <= 4.2e+123)
tmp = t_1;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[((-x) / z), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / z), $MachinePrecision]}, If[LessEqual[z, -2.7e+127], t$95$3, If[LessEqual[z, -13500000.0], N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 5.6e+23], t$95$1, If[LessEqual[z, 4.5e+108], N[(t$95$2 / y), $MachinePrecision], If[LessEqual[z, 4.2e+123], t$95$1, t$95$3]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{t}}{y}\\
t_2 := \frac{-x}{z}\\
t_3 := \frac{t\_2}{z}\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+127}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -13500000:\\
\;\;\;\;\frac{\frac{-x}{t}}{z}\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+108}:\\
\;\;\;\;\frac{t\_2}{y}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -2.7000000000000002e127 or 4.19999999999999988e123 < z Initial program 84.0%
Taylor expanded in y around 0 82.8%
associate-*r/82.8%
neg-mul-182.8%
Simplified82.8%
div-inv82.8%
add-sqr-sqrt33.4%
sqrt-unprod71.8%
sqr-neg71.8%
sqrt-unprod48.2%
add-sqr-sqrt80.4%
associate-/r*80.3%
Applied egg-rr80.3%
*-commutative80.3%
associate-*l/77.7%
associate-*r/77.7%
associate-*l/77.7%
*-lft-identity77.7%
Simplified77.7%
Taylor expanded in t around 0 75.0%
associate-*r/75.0%
neg-mul-175.0%
Simplified75.0%
if -2.7000000000000002e127 < z < -1.35e7Initial program 92.4%
Taylor expanded in y around 0 72.6%
associate-*r/72.6%
neg-mul-172.6%
Simplified72.6%
Taylor expanded in z around 0 26.3%
associate-*r/26.3%
neg-mul-126.3%
Simplified26.3%
Taylor expanded in x around 0 26.3%
mul-1-neg26.3%
associate-/r*26.4%
distribute-neg-frac26.4%
Simplified26.4%
if -1.35e7 < z < 5.6e23 or 4.5e108 < z < 4.19999999999999988e123Initial program 93.6%
Taylor expanded in y around inf 70.4%
*-commutative70.4%
associate-/r*73.3%
Simplified73.3%
Taylor expanded in t around inf 59.5%
if 5.6e23 < z < 4.5e108Initial program 93.5%
Taylor expanded in y around inf 26.9%
*-commutative26.9%
associate-/r*34.0%
Simplified34.0%
Taylor expanded in t around 0 26.7%
associate-*r/23.2%
neg-mul-123.2%
Simplified26.7%
Final simplification59.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -1.25e+225)
(/ (/ x y) t)
(if (<= y -4.8e+38)
(/ (- x) (* y z))
(if (or (<= y -7e-138) (not (<= y 2.2e-29)))
(/ (/ x t) y)
(/ (- x) (* z t))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.25e+225) {
tmp = (x / y) / t;
} else if (y <= -4.8e+38) {
tmp = -x / (y * z);
} else if ((y <= -7e-138) || !(y <= 2.2e-29)) {
tmp = (x / t) / y;
} else {
tmp = -x / (z * t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 <= (-1.25d+225)) then
tmp = (x / y) / t
else if (y <= (-4.8d+38)) then
tmp = -x / (y * z)
else if ((y <= (-7d-138)) .or. (.not. (y <= 2.2d-29))) then
tmp = (x / t) / y
else
tmp = -x / (z * t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.25e+225) {
tmp = (x / y) / t;
} else if (y <= -4.8e+38) {
tmp = -x / (y * z);
} else if ((y <= -7e-138) || !(y <= 2.2e-29)) {
tmp = (x / t) / y;
} else {
tmp = -x / (z * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -1.25e+225: tmp = (x / y) / t elif y <= -4.8e+38: tmp = -x / (y * z) elif (y <= -7e-138) or not (y <= 2.2e-29): tmp = (x / t) / y else: tmp = -x / (z * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.25e+225) tmp = Float64(Float64(x / y) / t); elseif (y <= -4.8e+38) tmp = Float64(Float64(-x) / Float64(y * z)); elseif ((y <= -7e-138) || !(y <= 2.2e-29)) tmp = Float64(Float64(x / t) / y); else tmp = Float64(Float64(-x) / Float64(z * t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -1.25e+225)
tmp = (x / y) / t;
elseif (y <= -4.8e+38)
tmp = -x / (y * z);
elseif ((y <= -7e-138) || ~((y <= 2.2e-29)))
tmp = (x / t) / y;
else
tmp = -x / (z * t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -1.25e+225], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, -4.8e+38], N[((-x) / N[(y * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -7e-138], N[Not[LessEqual[y, 2.2e-29]], $MachinePrecision]], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+225}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{+38}:\\
\;\;\;\;\frac{-x}{y \cdot z}\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-138} \lor \neg \left(y \leq 2.2 \cdot 10^{-29}\right):\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\end{array}
\end{array}
if y < -1.24999999999999995e225Initial program 82.5%
add-cube-cbrt82.2%
times-frac93.8%
pow293.8%
Applied egg-rr93.8%
frac-times82.2%
unpow282.2%
add-cube-cbrt82.5%
*-un-lft-identity82.5%
frac-times88.1%
clear-num88.0%
un-div-inv88.0%
Applied egg-rr88.0%
Taylor expanded in z around 0 58.8%
*-commutative58.8%
associate-/r*76.0%
Simplified76.0%
if -1.24999999999999995e225 < y < -4.80000000000000035e38Initial program 86.0%
Taylor expanded in y around inf 76.7%
*-commutative76.7%
associate-/r*82.4%
Simplified82.4%
Taylor expanded in t around 0 56.5%
associate-*r/56.5%
neg-mul-156.5%
*-commutative56.5%
Simplified56.5%
if -4.80000000000000035e38 < y < -6.9999999999999997e-138 or 2.1999999999999999e-29 < y Initial program 95.1%
Taylor expanded in y around inf 76.5%
*-commutative76.5%
associate-/r*75.2%
Simplified75.2%
Taylor expanded in t around inf 54.8%
if -6.9999999999999997e-138 < y < 2.1999999999999999e-29Initial program 87.4%
Taylor expanded in y around 0 78.5%
associate-*r/78.5%
neg-mul-178.5%
Simplified78.5%
Taylor expanded in z around 0 45.2%
associate-*r/45.2%
neg-mul-145.2%
Simplified45.2%
Final simplification53.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -1.25e+201)
(/ (/ x y) (- t z))
(if (<= y -2.7e-27)
(/ x (* y (- t z)))
(if (<= y 1.05e-215) (/ (- x) (* z (- t z))) (/ x (* (- y z) t))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.25e+201) {
tmp = (x / y) / (t - z);
} else if (y <= -2.7e-27) {
tmp = x / (y * (t - z));
} else if (y <= 1.05e-215) {
tmp = -x / (z * (t - z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 <= (-1.25d+201)) then
tmp = (x / y) / (t - z)
else if (y <= (-2.7d-27)) then
tmp = x / (y * (t - z))
else if (y <= 1.05d-215) then
tmp = -x / (z * (t - z))
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.25e+201) {
tmp = (x / y) / (t - z);
} else if (y <= -2.7e-27) {
tmp = x / (y * (t - z));
} else if (y <= 1.05e-215) {
tmp = -x / (z * (t - z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -1.25e+201: tmp = (x / y) / (t - z) elif y <= -2.7e-27: tmp = x / (y * (t - z)) elif y <= 1.05e-215: tmp = -x / (z * (t - z)) else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.25e+201) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= -2.7e-27) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 1.05e-215) tmp = Float64(Float64(-x) / Float64(z * Float64(t - z))); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -1.25e+201)
tmp = (x / y) / (t - z);
elseif (y <= -2.7e-27)
tmp = x / (y * (t - z));
elseif (y <= 1.05e-215)
tmp = -x / (z * (t - z));
else
tmp = x / ((y - z) * t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -1.25e+201], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.7e-27], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e-215], N[((-x) / N[(z * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+201}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{-27}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-215}:\\
\;\;\;\;\frac{-x}{z \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -1.2499999999999999e201Initial program 80.3%
add-cube-cbrt79.9%
times-frac94.5%
pow294.5%
Applied egg-rr94.5%
Taylor expanded in y around inf 80.3%
associate-/r*94.8%
Simplified94.8%
if -1.2499999999999999e201 < y < -2.69999999999999989e-27Initial program 89.9%
Taylor expanded in y around inf 76.1%
*-commutative76.1%
Simplified76.1%
if -2.69999999999999989e-27 < y < 1.05e-215Initial program 89.9%
Taylor expanded in y around 0 80.7%
associate-*r/80.7%
neg-mul-180.7%
Simplified80.7%
if 1.05e-215 < y Initial program 92.9%
Taylor expanded in t around inf 64.6%
Final simplification74.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -700000000.0) (/ (/ x y) (- t z)) (if (<= t 3.7e-20) (/ (- x) (* z (- y z))) (/ x (* (- y z) t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -700000000.0) {
tmp = (x / y) / (t - z);
} else if (t <= 3.7e-20) {
tmp = -x / (z * (y - z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 (t <= (-700000000.0d0)) then
tmp = (x / y) / (t - z)
else if (t <= 3.7d-20) then
tmp = -x / (z * (y - z))
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -700000000.0) {
tmp = (x / y) / (t - z);
} else if (t <= 3.7e-20) {
tmp = -x / (z * (y - z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -700000000.0: tmp = (x / y) / (t - z) elif t <= 3.7e-20: tmp = -x / (z * (y - z)) else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -700000000.0) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 3.7e-20) tmp = Float64(Float64(-x) / Float64(z * Float64(y - z))); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -700000000.0)
tmp = (x / y) / (t - z);
elseif (t <= 3.7e-20)
tmp = -x / (z * (y - z));
else
tmp = x / ((y - z) * t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -700000000.0], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e-20], N[((-x) / N[(z * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -700000000:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-20}:\\
\;\;\;\;\frac{-x}{z \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -7e8Initial program 90.6%
add-cube-cbrt90.0%
times-frac95.9%
pow295.9%
Applied egg-rr95.9%
Taylor expanded in y around inf 61.2%
associate-/r*60.4%
Simplified60.4%
if -7e8 < t < 3.7000000000000001e-20Initial program 90.5%
Taylor expanded in t around 0 73.9%
associate-*r/73.9%
neg-mul-173.9%
Simplified73.9%
if 3.7000000000000001e-20 < t Initial program 90.4%
Taylor expanded in t around inf 83.8%
Final simplification73.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -530000000.0) (/ (/ x y) t) (if (<= t 3.8e-177) (/ (/ (- x) z) y) (/ x (* (- y z) t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -530000000.0) {
tmp = (x / y) / t;
} else if (t <= 3.8e-177) {
tmp = (-x / z) / y;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 (t <= (-530000000.0d0)) then
tmp = (x / y) / t
else if (t <= 3.8d-177) then
tmp = (-x / z) / y
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -530000000.0) {
tmp = (x / y) / t;
} else if (t <= 3.8e-177) {
tmp = (-x / z) / y;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -530000000.0: tmp = (x / y) / t elif t <= 3.8e-177: tmp = (-x / z) / y else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -530000000.0) tmp = Float64(Float64(x / y) / t); elseif (t <= 3.8e-177) tmp = Float64(Float64(Float64(-x) / z) / y); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -530000000.0)
tmp = (x / y) / t;
elseif (t <= 3.8e-177)
tmp = (-x / z) / y;
else
tmp = x / ((y - z) * t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -530000000.0], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 3.8e-177], N[(N[((-x) / z), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -530000000:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-177}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -5.3e8Initial program 90.6%
add-cube-cbrt90.0%
times-frac95.9%
pow295.9%
Applied egg-rr95.9%
frac-times90.0%
unpow290.0%
add-cube-cbrt90.6%
*-un-lft-identity90.6%
frac-times99.7%
clear-num99.6%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 54.8%
*-commutative54.8%
associate-/r*53.7%
Simplified53.7%
if -5.3e8 < t < 3.80000000000000004e-177Initial program 88.7%
Taylor expanded in y around inf 53.5%
*-commutative53.5%
associate-/r*56.6%
Simplified56.6%
Taylor expanded in t around 0 46.2%
associate-*r/31.9%
neg-mul-131.9%
Simplified46.2%
if 3.80000000000000004e-177 < t Initial program 92.0%
Taylor expanded in t around inf 72.3%
Final simplification58.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -2.15e+201) (/ (/ x y) (- t z)) (if (<= y -41000.0) (/ x (* y (- t z))) (/ x (* (- y z) t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.15e+201) {
tmp = (x / y) / (t - z);
} else if (y <= -41000.0) {
tmp = x / (y * (t - z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 <= (-2.15d+201)) then
tmp = (x / y) / (t - z)
else if (y <= (-41000.0d0)) then
tmp = x / (y * (t - z))
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.15e+201) {
tmp = (x / y) / (t - z);
} else if (y <= -41000.0) {
tmp = x / (y * (t - z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -2.15e+201: tmp = (x / y) / (t - z) elif y <= -41000.0: tmp = x / (y * (t - z)) else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.15e+201) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= -41000.0) tmp = Float64(x / Float64(y * Float64(t - z))); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -2.15e+201)
tmp = (x / y) / (t - z);
elseif (y <= -41000.0)
tmp = x / (y * (t - z));
else
tmp = x / ((y - z) * t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -2.15e+201], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -41000.0], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{+201}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq -41000:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -2.14999999999999995e201Initial program 80.3%
add-cube-cbrt79.9%
times-frac94.5%
pow294.5%
Applied egg-rr94.5%
Taylor expanded in y around inf 80.3%
associate-/r*94.8%
Simplified94.8%
if -2.14999999999999995e201 < y < -41000Initial program 90.7%
Taylor expanded in y around inf 77.4%
*-commutative77.4%
Simplified77.4%
if -41000 < y Initial program 91.5%
Taylor expanded in t around inf 59.4%
Final simplification64.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.7e-11) (/ (/ x y) t) (if (<= y 2.7e-28) (/ (- x) (* z t)) (/ (/ x t) y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e-11) {
tmp = (x / y) / t;
} else if (y <= 2.7e-28) {
tmp = -x / (z * t);
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 <= (-1.7d-11)) then
tmp = (x / y) / t
else if (y <= 2.7d-28) then
tmp = -x / (z * t)
else
tmp = (x / t) / y
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e-11) {
tmp = (x / y) / t;
} else if (y <= 2.7e-28) {
tmp = -x / (z * t);
} else {
tmp = (x / t) / y;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -1.7e-11: tmp = (x / y) / t elif y <= 2.7e-28: tmp = -x / (z * t) else: tmp = (x / t) / y return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e-11) tmp = Float64(Float64(x / y) / t); elseif (y <= 2.7e-28) tmp = Float64(Float64(-x) / Float64(z * t)); else tmp = Float64(Float64(x / t) / y); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -1.7e-11)
tmp = (x / y) / t;
elseif (y <= 2.7e-28)
tmp = -x / (z * t);
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e-11], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 2.7e-28], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-11}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-28}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if y < -1.6999999999999999e-11Initial program 86.6%
add-cube-cbrt85.8%
times-frac96.4%
pow296.4%
Applied egg-rr96.4%
frac-times85.8%
unpow285.8%
add-cube-cbrt86.6%
*-un-lft-identity86.6%
frac-times96.7%
clear-num96.5%
un-div-inv96.6%
Applied egg-rr96.6%
Taylor expanded in z around 0 51.4%
*-commutative51.4%
associate-/r*58.9%
Simplified58.9%
if -1.6999999999999999e-11 < y < 2.6999999999999999e-28Initial program 88.8%
Taylor expanded in y around 0 76.3%
associate-*r/76.3%
neg-mul-176.3%
Simplified76.3%
Taylor expanded in z around 0 42.7%
associate-*r/42.7%
neg-mul-142.7%
Simplified42.7%
if 2.6999999999999999e-28 < y Initial program 96.2%
Taylor expanded in y around inf 90.3%
*-commutative90.3%
associate-/r*86.2%
Simplified86.2%
Taylor expanded in t around inf 57.2%
Final simplification51.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -1.1e+19) (not (<= z 3.4e+27))) (/ x (* z t)) (/ x (* y t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.1e+19) || !(z <= 3.4e+27)) {
tmp = x / (z * t);
} else {
tmp = x / (y * t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 ((z <= (-1.1d+19)) .or. (.not. (z <= 3.4d+27))) then
tmp = x / (z * t)
else
tmp = x / (y * t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.1e+19) || !(z <= 3.4e+27)) {
tmp = x / (z * t);
} else {
tmp = x / (y * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.1e+19) or not (z <= 3.4e+27): tmp = x / (z * t) else: tmp = x / (y * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -1.1e+19) || !(z <= 3.4e+27)) tmp = Float64(x / Float64(z * t)); else tmp = Float64(x / Float64(y * t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -1.1e+19) || ~((z <= 3.4e+27)))
tmp = x / (z * t);
else
tmp = x / (y * t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.1e+19], N[Not[LessEqual[z, 3.4e+27]], $MachinePrecision]], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+19} \lor \neg \left(z \leq 3.4 \cdot 10^{+27}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.1e19 or 3.4e27 < z Initial program 86.3%
Taylor expanded in y around 0 81.4%
associate-*r/81.4%
neg-mul-181.4%
Simplified81.4%
div-inv81.4%
add-sqr-sqrt32.9%
sqrt-unprod61.7%
sqr-neg61.7%
sqrt-unprod37.3%
add-sqr-sqrt62.5%
associate-/r*62.5%
Applied egg-rr62.5%
*-commutative62.5%
associate-*l/60.7%
associate-*r/60.7%
associate-*l/60.7%
*-lft-identity60.7%
Simplified60.7%
Taylor expanded in t around inf 36.9%
*-commutative36.9%
Simplified36.9%
if -1.1e19 < z < 3.4e27Initial program 94.2%
Taylor expanded in z around 0 58.2%
Final simplification48.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -5.5e+62) (not (<= z 3.3e+124))) (/ x (* z t)) (/ (/ x t) y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.5e+62) || !(z <= 3.3e+124)) {
tmp = x / (z * t);
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 ((z <= (-5.5d+62)) .or. (.not. (z <= 3.3d+124))) then
tmp = x / (z * t)
else
tmp = (x / t) / y
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.5e+62) || !(z <= 3.3e+124)) {
tmp = x / (z * t);
} else {
tmp = (x / t) / y;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -5.5e+62) or not (z <= 3.3e+124): tmp = x / (z * t) else: tmp = (x / t) / y return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -5.5e+62) || !(z <= 3.3e+124)) tmp = Float64(x / Float64(z * t)); else tmp = Float64(Float64(x / t) / y); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -5.5e+62) || ~((z <= 3.3e+124)))
tmp = x / (z * t);
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.5e+62], N[Not[LessEqual[z, 3.3e+124]], $MachinePrecision]], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+62} \lor \neg \left(z \leq 3.3 \cdot 10^{+124}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -5.4999999999999997e62 or 3.30000000000000015e124 < z Initial program 85.3%
Taylor expanded in y around 0 82.1%
associate-*r/82.1%
neg-mul-182.1%
Simplified82.1%
div-inv82.2%
add-sqr-sqrt32.7%
sqrt-unprod67.2%
sqr-neg67.2%
sqrt-unprod44.4%
add-sqr-sqrt73.4%
associate-/r*73.4%
Applied egg-rr73.4%
*-commutative73.4%
associate-*l/71.1%
associate-*r/71.1%
associate-*l/71.1%
*-lft-identity71.1%
Simplified71.1%
Taylor expanded in t around inf 44.4%
*-commutative44.4%
Simplified44.4%
if -5.4999999999999997e62 < z < 3.30000000000000015e124Initial program 93.4%
Taylor expanded in y around inf 64.4%
*-commutative64.4%
associate-/r*67.9%
Simplified67.9%
Taylor expanded in t around inf 52.4%
Final simplification49.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.42e+200) (/ 1.0 (* (- t z) (/ y x))) (/ x (* (- y z) (- t z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.42e+200) {
tmp = 1.0 / ((t - z) * (y / x));
} else {
tmp = x / ((y - z) * (t - z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 <= (-1.42d+200)) then
tmp = 1.0d0 / ((t - z) * (y / x))
else
tmp = x / ((y - z) * (t - z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.42e+200) {
tmp = 1.0 / ((t - z) * (y / x));
} else {
tmp = x / ((y - z) * (t - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -1.42e+200: tmp = 1.0 / ((t - z) * (y / x)) else: tmp = x / ((y - z) * (t - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.42e+200) tmp = Float64(1.0 / Float64(Float64(t - z) * Float64(y / x))); else tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -1.42e+200)
tmp = 1.0 / ((t - z) * (y / x));
else
tmp = x / ((y - z) * (t - z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -1.42e+200], N[(1.0 / N[(N[(t - z), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.42 \cdot 10^{+200}:\\
\;\;\;\;\frac{1}{\left(t - z\right) \cdot \frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\end{array}
\end{array}
if y < -1.42e200Initial program 82.1%
Taylor expanded in y around inf 82.1%
*-commutative82.1%
associate-/r*90.7%
Simplified90.7%
clear-num90.7%
inv-pow90.7%
associate-/r/95.5%
Applied egg-rr95.5%
unpow-195.5%
*-commutative95.5%
Simplified95.5%
if -1.42e200 < y Initial program 91.2%
Final simplification91.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -165000.0) (/ x (* y (- t z))) (/ x (* (- y z) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -165000.0) {
tmp = x / (y * (t - z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 <= (-165000.0d0)) then
tmp = x / (y * (t - z))
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -165000.0) {
tmp = x / (y * (t - z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -165000.0: tmp = x / (y * (t - z)) else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -165000.0) tmp = Float64(x / Float64(y * Float64(t - z))); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -165000.0)
tmp = x / (y * (t - z));
else
tmp = x / ((y - z) * t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -165000.0], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -165000:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -165000Initial program 87.4%
Taylor expanded in y around inf 78.3%
*-commutative78.3%
Simplified78.3%
if -165000 < y Initial program 91.5%
Taylor expanded in t around inf 59.4%
Final simplification63.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 4.2e-20) (/ (/ x (- t z)) y) (/ x (* (- y z) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 4.2e-20) {
tmp = (x / (t - z)) / y;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 (t <= 4.2d-20) then
tmp = (x / (t - z)) / y
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 4.2e-20) {
tmp = (x / (t - z)) / y;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 4.2e-20: tmp = (x / (t - z)) / y else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 4.2e-20) tmp = Float64(Float64(x / Float64(t - z)) / y); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 4.2e-20)
tmp = (x / (t - z)) / y;
else
tmp = x / ((y - z) * t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 4.2e-20], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.2 \cdot 10^{-20}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < 4.1999999999999998e-20Initial program 90.5%
Taylor expanded in y around inf 57.3%
*-commutative57.3%
associate-/r*60.7%
Simplified60.7%
if 4.1999999999999998e-20 < t Initial program 90.4%
Taylor expanded in t around inf 83.8%
Final simplification67.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ (/ x (- y z)) (- t z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - z);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 - z)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - z);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (x / (y - z)) / (t - z)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(y - z)) / Float64(t - z)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (y - z)) / (t - z);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{\frac{x}{y - z}}{t - z}
\end{array}
Initial program 90.5%
add-cube-cbrt89.6%
times-frac95.8%
pow295.8%
Applied egg-rr95.8%
associate-*r/93.7%
associate-*l/93.7%
unpow293.7%
add-cube-cbrt94.6%
Applied egg-rr94.6%
Final simplification94.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* y t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return x / (y * t);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 * t)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return x / (y * t);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x / (y * t)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x / Float64(y * t)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = x / (y * t);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{y \cdot t}
\end{array}
Initial program 90.5%
Taylor expanded in z around 0 40.2%
Final simplification40.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z)))) (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / 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 = (y - z) * (t - z)
if ((x / t_1) < 0.0d0) then
tmp = (x / (y - z)) / (t - z)
else
tmp = x * (1.0d0 / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if (x / t_1) < 0.0: tmp = (x / (y - z)) / (t - z) else: tmp = x * (1.0 / t_1) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (Float64(x / t_1) < 0.0) tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); else tmp = Float64(x * Float64(1.0 / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); tmp = 0.0; if ((x / t_1) < 0.0) tmp = (x / (y - z)) / (t - z); else tmp = x * (1.0 / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t\_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024036
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:herbie-target
(if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))
(/ x (* (- y z) (- t z))))