
(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 17 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: y 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(y < t);
double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - z);
}
NOTE: y 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 y < t;
public static double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - z);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return (x / (y - z)) / (t - z)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(y - z)) / Float64(t - z)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (y - z)) / (t - z);
end
NOTE: y 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}
[y, t] = \mathsf{sort}([y, t])\\
\\
\frac{\frac{x}{y - z}}{t - z}
\end{array}
Initial program 87.6%
associate-/r*96.5%
Simplified96.5%
Final simplification96.5%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z)))) (if (<= t_1 2e+286) (/ x t_1) (/ (/ (- x) (- t z)) z))))
assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= 2e+286) {
tmp = x / t_1;
} else {
tmp = (-x / (t - z)) / z;
}
return tmp;
}
NOTE: y 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) :: tmp
t_1 = (y - z) * (t - z)
if (t_1 <= 2d+286) then
tmp = x / t_1
else
tmp = (-x / (t - z)) / z
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= 2e+286) {
tmp = x / t_1;
} else {
tmp = (-x / (t - z)) / z;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if t_1 <= 2e+286: tmp = x / t_1 else: tmp = (-x / (t - z)) / z return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (t_1 <= 2e+286) tmp = Float64(x / t_1); else tmp = Float64(Float64(Float64(-x) / Float64(t - z)) / z); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (y - z) * (t - z);
tmp = 0.0;
if (t_1 <= 2e+286)
tmp = x / t_1;
else
tmp = (-x / (t - z)) / z;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+286], N[(x / t$95$1), $MachinePrecision], N[(N[((-x) / N[(t - z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+286}:\\
\;\;\;\;\frac{x}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-x}{t - z}}{z}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < 2.00000000000000007e286Initial program 95.3%
if 2.00000000000000007e286 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 71.1%
associate-/r*99.9%
div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 69.9%
*-commutative69.9%
neg-mul-169.9%
associate-/r*89.4%
distribute-neg-frac89.4%
distribute-frac-neg89.4%
Simplified89.4%
Final simplification93.4%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -5.3e-14)
(/ (/ x y) (- t z))
(if (<= y -6.8e-68)
(/ 1.0 (/ z (/ x z)))
(if (<= y -6.4e-78)
(/ x (* y (- z)))
(if (<= y 1.6e-229) (/ x (* z (- z t))) (/ x (* (- y z) t)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.3e-14) {
tmp = (x / y) / (t - z);
} else if (y <= -6.8e-68) {
tmp = 1.0 / (z / (x / z));
} else if (y <= -6.4e-78) {
tmp = x / (y * -z);
} else if (y <= 1.6e-229) {
tmp = x / (z * (z - t));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
NOTE: y 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 <= (-5.3d-14)) then
tmp = (x / y) / (t - z)
else if (y <= (-6.8d-68)) then
tmp = 1.0d0 / (z / (x / z))
else if (y <= (-6.4d-78)) then
tmp = x / (y * -z)
else if (y <= 1.6d-229) then
tmp = x / (z * (z - t))
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.3e-14) {
tmp = (x / y) / (t - z);
} else if (y <= -6.8e-68) {
tmp = 1.0 / (z / (x / z));
} else if (y <= -6.4e-78) {
tmp = x / (y * -z);
} else if (y <= 1.6e-229) {
tmp = x / (z * (z - t));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -5.3e-14: tmp = (x / y) / (t - z) elif y <= -6.8e-68: tmp = 1.0 / (z / (x / z)) elif y <= -6.4e-78: tmp = x / (y * -z) elif y <= 1.6e-229: tmp = x / (z * (z - t)) else: tmp = x / ((y - z) * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -5.3e-14) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= -6.8e-68) tmp = Float64(1.0 / Float64(z / Float64(x / z))); elseif (y <= -6.4e-78) tmp = Float64(x / Float64(y * Float64(-z))); elseif (y <= 1.6e-229) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -5.3e-14)
tmp = (x / y) / (t - z);
elseif (y <= -6.8e-68)
tmp = 1.0 / (z / (x / z));
elseif (y <= -6.4e-78)
tmp = x / (y * -z);
elseif (y <= 1.6e-229)
tmp = x / (z * (z - t));
else
tmp = x / ((y - z) * t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -5.3e-14], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.8e-68], N[(1.0 / N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.4e-78], N[(x / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-229], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.3 \cdot 10^{-14}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq -6.8 \cdot 10^{-68}:\\
\;\;\;\;\frac{1}{\frac{z}{\frac{x}{z}}}\\
\mathbf{elif}\;y \leq -6.4 \cdot 10^{-78}:\\
\;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-229}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -5.3000000000000001e-14Initial program 86.6%
associate-/r*97.0%
Simplified97.0%
Taylor expanded in y around inf 86.1%
if -5.3000000000000001e-14 < y < -6.80000000000000037e-68Initial program 99.7%
associate-/r*99.3%
div-inv99.5%
Applied egg-rr99.5%
associate-*l/99.6%
div-inv99.7%
clear-num99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 43.7%
unpow243.7%
associate-/l*43.7%
Simplified43.7%
if -6.80000000000000037e-68 < y < -6.4e-78Initial program 99.2%
Taylor expanded in y around inf 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in t around 0 50.1%
mul-1-neg50.1%
distribute-rgt-neg-out50.1%
Simplified50.1%
if -6.4e-78 < y < 1.60000000000000007e-229Initial program 87.7%
frac-2neg87.7%
div-inv87.7%
distribute-rgt-neg-in87.7%
Applied egg-rr87.7%
Taylor expanded in y around 0 79.1%
if 1.60000000000000007e-229 < y Initial program 86.8%
Taylor expanded in t around inf 58.9%
Final simplification70.5%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -3.7e+116)
(* (/ x z) (/ 1.0 z))
(if (<= z -2.6e-23)
(/ x (* z (- z t)))
(if (<= z 6700000000.0) (/ x (* (- y z) t)) (/ (/ x z) z)))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e+116) {
tmp = (x / z) * (1.0 / z);
} else if (z <= -2.6e-23) {
tmp = x / (z * (z - t));
} else if (z <= 6700000000.0) {
tmp = x / ((y - z) * t);
} else {
tmp = (x / z) / z;
}
return tmp;
}
NOTE: y 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 <= (-3.7d+116)) then
tmp = (x / z) * (1.0d0 / z)
else if (z <= (-2.6d-23)) then
tmp = x / (z * (z - t))
else if (z <= 6700000000.0d0) then
tmp = x / ((y - z) * t)
else
tmp = (x / z) / z
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e+116) {
tmp = (x / z) * (1.0 / z);
} else if (z <= -2.6e-23) {
tmp = x / (z * (z - t));
} else if (z <= 6700000000.0) {
tmp = x / ((y - z) * t);
} else {
tmp = (x / z) / z;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -3.7e+116: tmp = (x / z) * (1.0 / z) elif z <= -2.6e-23: tmp = x / (z * (z - t)) elif z <= 6700000000.0: tmp = x / ((y - z) * t) else: tmp = (x / z) / z return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -3.7e+116) tmp = Float64(Float64(x / z) * Float64(1.0 / z)); elseif (z <= -2.6e-23) tmp = Float64(x / Float64(z * Float64(z - t))); elseif (z <= 6700000000.0) tmp = Float64(x / Float64(Float64(y - z) * t)); else tmp = Float64(Float64(x / z) / z); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -3.7e+116)
tmp = (x / z) * (1.0 / z);
elseif (z <= -2.6e-23)
tmp = x / (z * (z - t));
elseif (z <= 6700000000.0)
tmp = x / ((y - z) * t);
else
tmp = (x / z) / z;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -3.7e+116], N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.6e-23], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6700000000.0], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+116}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-23}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{elif}\;z \leq 6700000000:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if z < -3.7000000000000001e116Initial program 80.4%
Taylor expanded in z around inf 76.8%
unpow276.8%
Simplified76.8%
*-un-lft-identity76.8%
times-frac92.9%
Applied egg-rr92.9%
*-commutative92.9%
Simplified92.9%
if -3.7000000000000001e116 < z < -2.6e-23Initial program 92.2%
frac-2neg92.2%
div-inv92.2%
distribute-rgt-neg-in92.2%
Applied egg-rr92.2%
Taylor expanded in y around 0 77.8%
if -2.6e-23 < z < 6.7e9Initial program 92.5%
Taylor expanded in t around inf 75.2%
if 6.7e9 < z Initial program 81.9%
Taylor expanded in z around inf 71.4%
unpow271.4%
associate-/r*79.5%
Simplified79.5%
Final simplification80.1%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -2.75e+88)
(* (/ x z) (/ 1.0 z))
(if (<= z -1.55e-258)
(/ (/ x t) (- y z))
(if (<= z 4.45e+18) (/ x (* y (- t z))) (/ (/ x z) z)))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.75e+88) {
tmp = (x / z) * (1.0 / z);
} else if (z <= -1.55e-258) {
tmp = (x / t) / (y - z);
} else if (z <= 4.45e+18) {
tmp = x / (y * (t - z));
} else {
tmp = (x / z) / z;
}
return tmp;
}
NOTE: y 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 <= (-2.75d+88)) then
tmp = (x / z) * (1.0d0 / z)
else if (z <= (-1.55d-258)) then
tmp = (x / t) / (y - z)
else if (z <= 4.45d+18) then
tmp = x / (y * (t - z))
else
tmp = (x / z) / z
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.75e+88) {
tmp = (x / z) * (1.0 / z);
} else if (z <= -1.55e-258) {
tmp = (x / t) / (y - z);
} else if (z <= 4.45e+18) {
tmp = x / (y * (t - z));
} else {
tmp = (x / z) / z;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -2.75e+88: tmp = (x / z) * (1.0 / z) elif z <= -1.55e-258: tmp = (x / t) / (y - z) elif z <= 4.45e+18: tmp = x / (y * (t - z)) else: tmp = (x / z) / z return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -2.75e+88) tmp = Float64(Float64(x / z) * Float64(1.0 / z)); elseif (z <= -1.55e-258) tmp = Float64(Float64(x / t) / Float64(y - z)); elseif (z <= 4.45e+18) tmp = Float64(x / Float64(y * Float64(t - z))); else tmp = Float64(Float64(x / z) / z); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -2.75e+88)
tmp = (x / z) * (1.0 / z);
elseif (z <= -1.55e-258)
tmp = (x / t) / (y - z);
elseif (z <= 4.45e+18)
tmp = x / (y * (t - z));
else
tmp = (x / z) / z;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -2.75e+88], N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.55e-258], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.45e+18], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.75 \cdot 10^{+88}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-258}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\mathbf{elif}\;z \leq 4.45 \cdot 10^{+18}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if z < -2.75e88Initial program 80.4%
Taylor expanded in z around inf 76.8%
unpow276.8%
Simplified76.8%
*-un-lft-identity76.8%
times-frac92.9%
Applied egg-rr92.9%
*-commutative92.9%
Simplified92.9%
if -2.75e88 < z < -1.54999999999999999e-258Initial program 89.8%
associate-/l/98.1%
Simplified98.1%
Taylor expanded in t around inf 74.7%
if -1.54999999999999999e-258 < z < 4.45e18Initial program 94.8%
Taylor expanded in y around inf 79.1%
*-commutative79.1%
Simplified79.1%
if 4.45e18 < z Initial program 81.5%
Taylor expanded in z around inf 72.5%
unpow272.5%
associate-/r*80.7%
Simplified80.7%
Final simplification81.1%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -1.8e-154) (/ (/ x y) (- t z)) (if (<= t 1.35e-60) (/ (- x) (* z (- y z))) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.8e-154) {
tmp = (x / y) / (t - z);
} else if (t <= 1.35e-60) {
tmp = -x / (z * (y - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y 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 <= (-1.8d-154)) then
tmp = (x / y) / (t - z)
else if (t <= 1.35d-60) then
tmp = -x / (z * (y - z))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.8e-154) {
tmp = (x / y) / (t - z);
} else if (t <= 1.35e-60) {
tmp = -x / (z * (y - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= -1.8e-154: tmp = (x / y) / (t - z) elif t <= 1.35e-60: tmp = -x / (z * (y - z)) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -1.8e-154) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 1.35e-60) tmp = Float64(Float64(-x) / Float64(z * Float64(y - z))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -1.8e-154)
tmp = (x / y) / (t - z);
elseif (t <= 1.35e-60)
tmp = -x / (z * (y - z));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -1.8e-154], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e-60], N[((-x) / N[(z * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-154}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{-60}:\\
\;\;\;\;\frac{-x}{z \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.8000000000000001e-154Initial program 83.2%
associate-/r*96.9%
Simplified96.9%
Taylor expanded in y around inf 58.7%
if -1.8000000000000001e-154 < t < 1.35e-60Initial program 86.6%
Taylor expanded in t around 0 65.9%
associate-*r/65.9%
neg-mul-165.9%
*-commutative65.9%
Simplified65.9%
if 1.35e-60 < t Initial program 94.1%
associate-/l/98.5%
Simplified98.5%
Taylor expanded in t around inf 86.0%
Final simplification69.4%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -2.2e+47) (/ (/ x y) (- t z)) (if (<= y 7.5e-228) (/ (/ (- x) z) (- t z)) (/ x (* (- y z) t)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.2e+47) {
tmp = (x / y) / (t - z);
} else if (y <= 7.5e-228) {
tmp = (-x / z) / (t - z);
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
NOTE: y 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.2d+47)) then
tmp = (x / y) / (t - z)
else if (y <= 7.5d-228) then
tmp = (-x / z) / (t - z)
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.2e+47) {
tmp = (x / y) / (t - z);
} else if (y <= 7.5e-228) {
tmp = (-x / z) / (t - z);
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -2.2e+47: tmp = (x / y) / (t - z) elif y <= 7.5e-228: tmp = (-x / z) / (t - z) else: tmp = x / ((y - z) * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.2e+47) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 7.5e-228) tmp = Float64(Float64(Float64(-x) / z) / Float64(t - z)); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -2.2e+47)
tmp = (x / y) / (t - z);
elseif (y <= 7.5e-228)
tmp = (-x / z) / (t - z);
else
tmp = x / ((y - z) * t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -2.2e+47], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e-228], N[(N[((-x) / z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+47}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-228}:\\
\;\;\;\;\frac{\frac{-x}{z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -2.1999999999999999e47Initial program 87.6%
associate-/r*96.7%
Simplified96.7%
Taylor expanded in y around inf 91.8%
if -2.1999999999999999e47 < y < 7.4999999999999999e-228Initial program 88.8%
Taylor expanded in y around 0 71.2%
mul-1-neg71.2%
distribute-frac-neg71.2%
associate-/r*80.8%
Simplified80.8%
if 7.4999999999999999e-228 < y Initial program 86.8%
Taylor expanded in t around inf 58.9%
Final simplification74.0%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -3.6e+46) (/ (/ x y) (- t z)) (if (<= y 7.5e-228) (/ (/ (- x) (- t z)) z) (/ x (* (- y z) t)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.6e+46) {
tmp = (x / y) / (t - z);
} else if (y <= 7.5e-228) {
tmp = (-x / (t - z)) / z;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
NOTE: y 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 <= (-3.6d+46)) then
tmp = (x / y) / (t - z)
else if (y <= 7.5d-228) then
tmp = (-x / (t - z)) / z
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.6e+46) {
tmp = (x / y) / (t - z);
} else if (y <= 7.5e-228) {
tmp = (-x / (t - z)) / z;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -3.6e+46: tmp = (x / y) / (t - z) elif y <= 7.5e-228: tmp = (-x / (t - z)) / z else: tmp = x / ((y - z) * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -3.6e+46) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 7.5e-228) tmp = Float64(Float64(Float64(-x) / Float64(t - z)) / z); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -3.6e+46)
tmp = (x / y) / (t - z);
elseif (y <= 7.5e-228)
tmp = (-x / (t - z)) / z;
else
tmp = x / ((y - z) * t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -3.6e+46], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e-228], N[(N[((-x) / N[(t - z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{+46}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-228}:\\
\;\;\;\;\frac{\frac{-x}{t - z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -3.5999999999999999e46Initial program 87.6%
associate-/r*96.7%
Simplified96.7%
Taylor expanded in y around inf 91.8%
if -3.5999999999999999e46 < y < 7.4999999999999999e-228Initial program 88.8%
associate-/r*96.4%
div-inv96.4%
Applied egg-rr96.4%
Taylor expanded in y around 0 71.2%
*-commutative71.2%
neg-mul-171.2%
associate-/r*81.0%
distribute-neg-frac81.0%
distribute-frac-neg81.0%
Simplified81.0%
if 7.4999999999999999e-228 < y Initial program 86.8%
Taylor expanded in t around inf 58.9%
Final simplification74.1%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -57.0) (not (<= z 6400000000.0))) (/ (/ x z) z) (* (/ x t) (/ 1.0 y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -57.0) || !(z <= 6400000000.0)) {
tmp = (x / z) / z;
} else {
tmp = (x / t) * (1.0 / y);
}
return tmp;
}
NOTE: y 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 <= (-57.0d0)) .or. (.not. (z <= 6400000000.0d0))) then
tmp = (x / z) / z
else
tmp = (x / t) * (1.0d0 / y)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -57.0) || !(z <= 6400000000.0)) {
tmp = (x / z) / z;
} else {
tmp = (x / t) * (1.0 / y);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -57.0) or not (z <= 6400000000.0): tmp = (x / z) / z else: tmp = (x / t) * (1.0 / y) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -57.0) || !(z <= 6400000000.0)) tmp = Float64(Float64(x / z) / z); else tmp = Float64(Float64(x / t) * Float64(1.0 / y)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -57.0) || ~((z <= 6400000000.0)))
tmp = (x / z) / z;
else
tmp = (x / t) * (1.0 / y);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -57.0], N[Not[LessEqual[z, 6400000000.0]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / t), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -57 \lor \neg \left(z \leq 6400000000\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if z < -57 or 6.4e9 < z Initial program 82.1%
Taylor expanded in z around inf 69.3%
unpow269.3%
associate-/r*79.6%
Simplified79.6%
if -57 < z < 6.4e9Initial program 93.0%
Taylor expanded in z around 0 60.4%
*-un-lft-identity60.4%
times-frac62.8%
Applied egg-rr62.8%
Final simplification71.1%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -1500.0) (* (/ x z) (/ 1.0 z)) (if (<= z 460000000.0) (* (/ x t) (/ 1.0 y)) (/ (/ x z) z))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1500.0) {
tmp = (x / z) * (1.0 / z);
} else if (z <= 460000000.0) {
tmp = (x / t) * (1.0 / y);
} else {
tmp = (x / z) / z;
}
return tmp;
}
NOTE: y 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 <= (-1500.0d0)) then
tmp = (x / z) * (1.0d0 / z)
else if (z <= 460000000.0d0) then
tmp = (x / t) * (1.0d0 / y)
else
tmp = (x / z) / z
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1500.0) {
tmp = (x / z) * (1.0 / z);
} else if (z <= 460000000.0) {
tmp = (x / t) * (1.0 / y);
} else {
tmp = (x / z) / z;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -1500.0: tmp = (x / z) * (1.0 / z) elif z <= 460000000.0: tmp = (x / t) * (1.0 / y) else: tmp = (x / z) / z return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1500.0) tmp = Float64(Float64(x / z) * Float64(1.0 / z)); elseif (z <= 460000000.0) tmp = Float64(Float64(x / t) * Float64(1.0 / y)); else tmp = Float64(Float64(x / z) / z); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -1500.0)
tmp = (x / z) * (1.0 / z);
elseif (z <= 460000000.0)
tmp = (x / t) * (1.0 / y);
else
tmp = (x / z) / z;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -1500.0], N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 460000000.0], N[(N[(x / t), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1500:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\
\mathbf{elif}\;z \leq 460000000:\\
\;\;\;\;\frac{x}{t} \cdot \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if z < -1500Initial program 82.3%
Taylor expanded in z around inf 67.6%
unpow267.6%
Simplified67.6%
*-un-lft-identity67.6%
times-frac79.8%
Applied egg-rr79.8%
*-commutative79.8%
Simplified79.8%
if -1500 < z < 4.6e8Initial program 93.0%
Taylor expanded in z around 0 60.4%
*-un-lft-identity60.4%
times-frac62.8%
Applied egg-rr62.8%
if 4.6e8 < z Initial program 81.9%
Taylor expanded in z around inf 71.4%
unpow271.4%
associate-/r*79.5%
Simplified79.5%
Final simplification71.1%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -6.6e+94) (* (/ x z) (/ 1.0 z)) (if (<= z 44000000000.0) (/ x (* (- y z) t)) (/ (/ x z) z))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.6e+94) {
tmp = (x / z) * (1.0 / z);
} else if (z <= 44000000000.0) {
tmp = x / ((y - z) * t);
} else {
tmp = (x / z) / z;
}
return tmp;
}
NOTE: y 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 <= (-6.6d+94)) then
tmp = (x / z) * (1.0d0 / z)
else if (z <= 44000000000.0d0) then
tmp = x / ((y - z) * t)
else
tmp = (x / z) / z
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.6e+94) {
tmp = (x / z) * (1.0 / z);
} else if (z <= 44000000000.0) {
tmp = x / ((y - z) * t);
} else {
tmp = (x / z) / z;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -6.6e+94: tmp = (x / z) * (1.0 / z) elif z <= 44000000000.0: tmp = x / ((y - z) * t) else: tmp = (x / z) / z return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -6.6e+94) tmp = Float64(Float64(x / z) * Float64(1.0 / z)); elseif (z <= 44000000000.0) tmp = Float64(x / Float64(Float64(y - z) * t)); else tmp = Float64(Float64(x / z) / z); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -6.6e+94)
tmp = (x / z) * (1.0 / z);
elseif (z <= 44000000000.0)
tmp = x / ((y - z) * t);
else
tmp = (x / z) / z;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -6.6e+94], N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 44000000000.0], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+94}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\
\mathbf{elif}\;z \leq 44000000000:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if z < -6.6e94Initial program 80.4%
Taylor expanded in z around inf 76.8%
unpow276.8%
Simplified76.8%
*-un-lft-identity76.8%
times-frac92.9%
Applied egg-rr92.9%
*-commutative92.9%
Simplified92.9%
if -6.6e94 < z < 4.4e10Initial program 92.5%
Taylor expanded in t around inf 71.6%
if 4.4e10 < z Initial program 81.9%
Taylor expanded in z around inf 71.4%
unpow271.4%
associate-/r*79.5%
Simplified79.5%
Final simplification77.7%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -2.75e+78) (not (<= z 8.6e+113))) (/ x (* z t)) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.75e+78) || !(z <= 8.6e+113)) {
tmp = x / (z * t);
} else {
tmp = x / (y * t);
}
return tmp;
}
NOTE: y 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 <= (-2.75d+78)) .or. (.not. (z <= 8.6d+113))) then
tmp = x / (z * t)
else
tmp = x / (y * t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.75e+78) || !(z <= 8.6e+113)) {
tmp = x / (z * t);
} else {
tmp = x / (y * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -2.75e+78) or not (z <= 8.6e+113): tmp = x / (z * t) else: tmp = x / (y * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -2.75e+78) || !(z <= 8.6e+113)) tmp = Float64(x / Float64(z * t)); else tmp = Float64(x / Float64(y * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -2.75e+78) || ~((z <= 8.6e+113)))
tmp = x / (z * t);
else
tmp = x / (y * t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.75e+78], N[Not[LessEqual[z, 8.6e+113]], $MachinePrecision]], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.75 \cdot 10^{+78} \lor \neg \left(z \leq 8.6 \cdot 10^{+113}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -2.7499999999999999e78 or 8.6000000000000007e113 < z Initial program 79.1%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around inf 44.6%
Taylor expanded in y around 0 44.8%
mul-1-neg44.8%
associate-/r*44.6%
distribute-neg-frac44.6%
distribute-neg-frac44.6%
Simplified44.6%
expm1-log1p-u44.2%
expm1-udef58.7%
associate-/l/58.7%
add-sqr-sqrt22.2%
sqrt-unprod55.9%
sqr-neg55.9%
sqrt-unprod36.7%
add-sqr-sqrt58.9%
Applied egg-rr58.9%
expm1-def43.0%
expm1-log1p43.2%
Simplified43.2%
if -2.7499999999999999e78 < z < 8.6000000000000007e113Initial program 92.2%
Taylor expanded in z around 0 52.9%
Final simplification49.6%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -410.0) (not (<= z 90000000000.0))) (/ x (* z z)) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -410.0) || !(z <= 90000000000.0)) {
tmp = x / (z * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
NOTE: y 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 <= (-410.0d0)) .or. (.not. (z <= 90000000000.0d0))) then
tmp = x / (z * z)
else
tmp = x / (y * t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -410.0) || !(z <= 90000000000.0)) {
tmp = x / (z * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -410.0) or not (z <= 90000000000.0): tmp = x / (z * z) else: tmp = x / (y * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -410.0) || !(z <= 90000000000.0)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(x / Float64(y * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -410.0) || ~((z <= 90000000000.0)))
tmp = x / (z * z);
else
tmp = x / (y * t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -410.0], N[Not[LessEqual[z, 90000000000.0]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -410 \lor \neg \left(z \leq 90000000000\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -410 or 9e10 < z Initial program 82.1%
Taylor expanded in z around inf 69.3%
unpow269.3%
Simplified69.3%
if -410 < z < 9e10Initial program 93.0%
Taylor expanded in z around 0 60.4%
Final simplification64.8%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -850.0) (not (<= z 95000000000.0))) (/ (/ x z) z) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -850.0) || !(z <= 95000000000.0)) {
tmp = (x / z) / z;
} else {
tmp = x / (y * t);
}
return tmp;
}
NOTE: y 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 <= (-850.0d0)) .or. (.not. (z <= 95000000000.0d0))) then
tmp = (x / z) / z
else
tmp = x / (y * t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -850.0) || !(z <= 95000000000.0)) {
tmp = (x / z) / z;
} else {
tmp = x / (y * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -850.0) or not (z <= 95000000000.0): tmp = (x / z) / z else: tmp = x / (y * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -850.0) || !(z <= 95000000000.0)) tmp = Float64(Float64(x / z) / z); else tmp = Float64(x / Float64(y * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -850.0) || ~((z <= 95000000000.0)))
tmp = (x / z) / z;
else
tmp = x / (y * t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -850.0], N[Not[LessEqual[z, 95000000000.0]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -850 \lor \neg \left(z \leq 95000000000\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -850 or 9.5e10 < z Initial program 82.1%
Taylor expanded in z around inf 69.3%
unpow269.3%
associate-/r*79.6%
Simplified79.6%
if -850 < z < 9.5e10Initial program 93.0%
Taylor expanded in z around 0 60.4%
Final simplification69.8%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -2.2e+80) (/ x (* z t)) (if (<= z 3.2e+118) (/ x (* y t)) (/ x (* y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e+80) {
tmp = x / (z * t);
} else if (z <= 3.2e+118) {
tmp = x / (y * t);
} else {
tmp = x / (y * z);
}
return tmp;
}
NOTE: y 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 <= (-2.2d+80)) then
tmp = x / (z * t)
else if (z <= 3.2d+118) then
tmp = x / (y * t)
else
tmp = x / (y * z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e+80) {
tmp = x / (z * t);
} else if (z <= 3.2e+118) {
tmp = x / (y * t);
} else {
tmp = x / (y * z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -2.2e+80: tmp = x / (z * t) elif z <= 3.2e+118: tmp = x / (y * t) else: tmp = x / (y * z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -2.2e+80) tmp = Float64(x / Float64(z * t)); elseif (z <= 3.2e+118) tmp = Float64(x / Float64(y * t)); else tmp = Float64(x / Float64(y * z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -2.2e+80)
tmp = x / (z * t);
elseif (z <= 3.2e+118)
tmp = x / (y * t);
else
tmp = x / (y * z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -2.2e+80], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+118], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+80}:\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+118}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot z}\\
\end{array}
\end{array}
if z < -2.20000000000000003e80Initial program 81.1%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around inf 47.2%
Taylor expanded in y around 0 48.9%
mul-1-neg48.9%
associate-/r*47.1%
distribute-neg-frac47.1%
distribute-neg-frac47.1%
Simplified47.1%
expm1-log1p-u46.8%
expm1-udef64.8%
associate-/l/64.8%
add-sqr-sqrt26.2%
sqrt-unprod62.5%
sqr-neg62.5%
sqrt-unprod38.7%
add-sqr-sqrt65.1%
Applied egg-rr65.1%
expm1-def46.1%
expm1-log1p46.2%
Simplified46.2%
if -2.20000000000000003e80 < z < 3.20000000000000016e118Initial program 91.8%
Taylor expanded in z around 0 52.9%
if 3.20000000000000016e118 < z Initial program 77.1%
Taylor expanded in y around inf 42.0%
*-commutative42.0%
Simplified42.0%
Taylor expanded in t around 0 42.0%
mul-1-neg42.0%
associate-/r*40.5%
distribute-neg-frac40.5%
distribute-neg-frac40.5%
Simplified40.5%
expm1-log1p-u40.3%
expm1-udef58.5%
associate-/l/58.6%
add-sqr-sqrt19.2%
sqrt-unprod54.2%
sqr-neg54.2%
sqrt-unprod39.0%
add-sqr-sqrt58.3%
Applied egg-rr58.3%
expm1-def41.8%
expm1-log1p42.1%
Simplified42.1%
Final simplification50.1%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ (/ x (- t z)) (- y z)))
assert(y < t);
double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
NOTE: y 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 / (t - z)) / (y - z)
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return (x / (t - z)) / (y - z)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(t - z)) / Float64(y - z)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (t - z)) / (y - z);
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\frac{\frac{x}{t - z}}{y - z}
\end{array}
Initial program 87.6%
associate-/l/96.4%
Simplified96.4%
Final simplification96.4%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* y t)))
assert(y < t);
double code(double x, double y, double z, double t) {
return x / (y * t);
}
NOTE: y 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 y < t;
public static double code(double x, double y, double z, double t) {
return x / (y * t);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return x / (y * t)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(x / Float64(y * t)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = x / (y * t);
end
NOTE: y 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}
[y, t] = \mathsf{sort}([y, t])\\
\\
\frac{x}{y \cdot t}
\end{array}
Initial program 87.6%
Taylor expanded in z around 0 43.2%
Final simplification43.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 2023238
(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))))