
(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 18 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 (let* ((t_1 (/ x (* (- y z) (- t z))))) (if (<= t_1 -1e-299) t_1 (/ (/ x (- t z)) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (t - z));
double tmp;
if (t_1 <= -1e-299) {
tmp = t_1;
} else {
tmp = (x / (t - z)) / (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) :: t_1
real(8) :: tmp
t_1 = x / ((y - z) * (t - z))
if (t_1 <= (-1d-299)) then
tmp = t_1
else
tmp = (x / (t - z)) / (y - 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 = x / ((y - z) * (t - z));
double tmp;
if (t_1 <= -1e-299) {
tmp = t_1;
} else {
tmp = (x / (t - z)) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = x / ((y - z) * (t - z)) tmp = 0 if t_1 <= -1e-299: tmp = t_1 else: tmp = (x / (t - z)) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(y - z) * Float64(t - z))) tmp = 0.0 if (t_1 <= -1e-299) tmp = t_1; else tmp = Float64(Float64(x / Float64(t - z)) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = x / ((y - z) * (t - z));
tmp = 0.0;
if (t_1 <= -1e-299)
tmp = t_1;
else
tmp = (x / (t - z)) / (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_] := Block[{t$95$1 = N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-299], t$95$1, N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-299}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -9.99999999999999992e-300Initial program 99.5%
if -9.99999999999999992e-300 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 84.7%
*-un-lft-identity84.7%
times-frac97.9%
*-commutative97.9%
Applied egg-rr97.9%
un-div-inv97.9%
Applied egg-rr97.9%
Final simplification98.3%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t -1.3e-163)
(/ (/ x y) (- t z))
(if (<= t 7e-152)
(/ (- x) (* z (- y z)))
(if (<= t 2.7e-78)
(/ (/ x (- t z)) y)
(if (<= t 1.4e+21)
(/ x (* z (- z t)))
(if (<= t 6.6e+184) (/ x (* (- y z) t)) (/ (/ x t) (- y z))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.3e-163) {
tmp = (x / y) / (t - z);
} else if (t <= 7e-152) {
tmp = -x / (z * (y - z));
} else if (t <= 2.7e-78) {
tmp = (x / (t - z)) / y;
} else if (t <= 1.4e+21) {
tmp = x / (z * (z - t));
} else if (t <= 6.6e+184) {
tmp = x / ((y - z) * t);
} 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.3d-163)) then
tmp = (x / y) / (t - z)
else if (t <= 7d-152) then
tmp = -x / (z * (y - z))
else if (t <= 2.7d-78) then
tmp = (x / (t - z)) / y
else if (t <= 1.4d+21) then
tmp = x / (z * (z - t))
else if (t <= 6.6d+184) then
tmp = x / ((y - z) * t)
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.3e-163) {
tmp = (x / y) / (t - z);
} else if (t <= 7e-152) {
tmp = -x / (z * (y - z));
} else if (t <= 2.7e-78) {
tmp = (x / (t - z)) / y;
} else if (t <= 1.4e+21) {
tmp = x / (z * (z - t));
} else if (t <= 6.6e+184) {
tmp = x / ((y - z) * t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= -1.3e-163: tmp = (x / y) / (t - z) elif t <= 7e-152: tmp = -x / (z * (y - z)) elif t <= 2.7e-78: tmp = (x / (t - z)) / y elif t <= 1.4e+21: tmp = x / (z * (z - t)) elif t <= 6.6e+184: tmp = x / ((y - z) * t) 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.3e-163) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 7e-152) tmp = Float64(Float64(-x) / Float64(z * Float64(y - z))); elseif (t <= 2.7e-78) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (t <= 1.4e+21) tmp = Float64(x / Float64(z * Float64(z - t))); elseif (t <= 6.6e+184) tmp = Float64(x / Float64(Float64(y - z) * t)); 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.3e-163)
tmp = (x / y) / (t - z);
elseif (t <= 7e-152)
tmp = -x / (z * (y - z));
elseif (t <= 2.7e-78)
tmp = (x / (t - z)) / y;
elseif (t <= 1.4e+21)
tmp = x / (z * (z - t));
elseif (t <= 6.6e+184)
tmp = x / ((y - z) * t);
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.3e-163], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e-152], N[((-x) / N[(z * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.7e-78], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 1.4e+21], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.6e+184], N[(x / N[(N[(y - z), $MachinePrecision] * t), $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.3 \cdot 10^{-163}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-152}:\\
\;\;\;\;\frac{-x}{z \cdot \left(y - z\right)}\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-78}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+21}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+184}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.30000000000000001e-163Initial program 91.6%
*-un-lft-identity91.6%
times-frac96.0%
*-commutative96.0%
Applied egg-rr96.0%
Taylor expanded in y around inf 63.0%
associate-/r*63.5%
Simplified63.5%
if -1.30000000000000001e-163 < t < 7.0000000000000002e-152Initial program 86.0%
Taylor expanded in t around 0 86.0%
associate-*r/86.0%
neg-mul-186.0%
Simplified86.0%
if 7.0000000000000002e-152 < t < 2.69999999999999994e-78Initial program 98.2%
*-un-lft-identity98.2%
times-frac99.6%
*-commutative99.6%
Applied egg-rr99.6%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 86.5%
*-commutative86.5%
associate-/r*94.0%
Simplified94.0%
if 2.69999999999999994e-78 < t < 1.4e21Initial program 91.4%
frac-2neg91.4%
div-inv91.1%
distribute-rgt-neg-in91.1%
Applied egg-rr91.1%
distribute-lft-neg-out91.1%
associate-*r/91.4%
*-rgt-identity91.4%
distribute-neg-frac91.4%
associate-/r*95.7%
neg-sub095.7%
associate--r-95.7%
neg-sub095.7%
Simplified95.7%
Taylor expanded in y around 0 69.5%
if 1.4e21 < t < 6.5999999999999996e184Initial program 84.4%
Taylor expanded in t around inf 72.4%
if 6.5999999999999996e184 < t Initial program 76.7%
Taylor expanded in t around inf 76.7%
associate-/r*83.3%
Simplified83.3%
Final simplification74.6%
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 5e+299) (/ x t_1) (/ (/ x z) (- z t)))))
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 <= 5e+299) {
tmp = x / t_1;
} else {
tmp = (x / z) / (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) :: t_1
real(8) :: tmp
t_1 = (y - z) * (t - z)
if (t_1 <= 5d+299) then
tmp = x / t_1
else
tmp = (x / z) / (z - t)
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 <= 5e+299) {
tmp = x / t_1;
} else {
tmp = (x / z) / (z - t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if t_1 <= 5e+299: tmp = x / t_1 else: tmp = (x / z) / (z - t) 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 <= 5e+299) tmp = Float64(x / t_1); else tmp = Float64(Float64(x / z) / Float64(z - t)); 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 <= 5e+299)
tmp = x / t_1;
else
tmp = (x / z) / (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_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+299], N[(x / t$95$1), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $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 5 \cdot 10^{+299}:\\
\;\;\;\;\frac{x}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < 5.0000000000000003e299Initial program 96.3%
if 5.0000000000000003e299 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 71.3%
frac-2neg71.3%
div-inv71.3%
distribute-rgt-neg-in71.3%
Applied egg-rr71.3%
distribute-lft-neg-out71.3%
associate-*r/71.3%
*-rgt-identity71.3%
distribute-neg-frac71.3%
associate-/r*99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
Simplified99.9%
Taylor expanded in y around 0 83.7%
Final simplification92.3%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -3.8e+83)
(- (/ x (* y z)))
(if (or (<= y -8e-100) (and (not (<= y 8500000000000.0)) (<= y 1.85e+151)))
(/ (/ x t) y)
(* (/ -1.0 z) (/ x t)))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.8e+83) {
tmp = -(x / (y * z));
} else if ((y <= -8e-100) || (!(y <= 8500000000000.0) && (y <= 1.85e+151))) {
tmp = (x / t) / y;
} else {
tmp = (-1.0 / z) * (x / 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.8d+83)) then
tmp = -(x / (y * z))
else if ((y <= (-8d-100)) .or. (.not. (y <= 8500000000000.0d0)) .and. (y <= 1.85d+151)) then
tmp = (x / t) / y
else
tmp = ((-1.0d0) / z) * (x / 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.8e+83) {
tmp = -(x / (y * z));
} else if ((y <= -8e-100) || (!(y <= 8500000000000.0) && (y <= 1.85e+151))) {
tmp = (x / t) / y;
} else {
tmp = (-1.0 / z) * (x / t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -3.8e+83: tmp = -(x / (y * z)) elif (y <= -8e-100) or (not (y <= 8500000000000.0) and (y <= 1.85e+151)): tmp = (x / t) / y else: tmp = (-1.0 / z) * (x / t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -3.8e+83) tmp = Float64(-Float64(x / Float64(y * z))); elseif ((y <= -8e-100) || (!(y <= 8500000000000.0) && (y <= 1.85e+151))) tmp = Float64(Float64(x / t) / y); else tmp = Float64(Float64(-1.0 / z) * Float64(x / 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.8e+83)
tmp = -(x / (y * z));
elseif ((y <= -8e-100) || (~((y <= 8500000000000.0)) && (y <= 1.85e+151)))
tmp = (x / t) / y;
else
tmp = (-1.0 / z) * (x / 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.8e+83], (-N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), If[Or[LessEqual[y, -8e-100], And[N[Not[LessEqual[y, 8500000000000.0]], $MachinePrecision], LessEqual[y, 1.85e+151]]], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], N[(N[(-1.0 / z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{+83}:\\
\;\;\;\;-\frac{x}{y \cdot z}\\
\mathbf{elif}\;y \leq -8 \cdot 10^{-100} \lor \neg \left(y \leq 8500000000000\right) \land y \leq 1.85 \cdot 10^{+151}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{z} \cdot \frac{x}{t}\\
\end{array}
\end{array}
if y < -3.8000000000000002e83Initial program 81.2%
Taylor expanded in t around 0 65.5%
associate-*r/65.5%
neg-mul-165.5%
Simplified65.5%
Taylor expanded in z around 0 65.5%
*-commutative65.5%
Simplified65.5%
if -3.8000000000000002e83 < y < -8.0000000000000002e-100 or 8.5e12 < y < 1.8499999999999999e151Initial program 94.5%
Taylor expanded in z around 0 47.6%
associate-/r*45.6%
Simplified45.6%
if -8.0000000000000002e-100 < y < 8.5e12 or 1.8499999999999999e151 < y Initial program 87.3%
*-un-lft-identity87.3%
times-frac94.1%
*-commutative94.1%
Applied egg-rr94.1%
Taylor expanded in y around 0 68.8%
Taylor expanded in t around inf 41.7%
Final simplification46.7%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -1.32e+284)
(/ (/ x y) (- t z))
(if (<= y -2.2e-16)
(/ x (* y (- t z)))
(if (<= y 1.7e+14) (* (/ x (- t z)) (/ -1.0 z)) (/ (/ x t) (- y z))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.32e+284) {
tmp = (x / y) / (t - z);
} else if (y <= -2.2e-16) {
tmp = x / (y * (t - z));
} else if (y <= 1.7e+14) {
tmp = (x / (t - z)) * (-1.0 / 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 (y <= (-1.32d+284)) then
tmp = (x / y) / (t - z)
else if (y <= (-2.2d-16)) then
tmp = x / (y * (t - z))
else if (y <= 1.7d+14) then
tmp = (x / (t - z)) * ((-1.0d0) / 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 (y <= -1.32e+284) {
tmp = (x / y) / (t - z);
} else if (y <= -2.2e-16) {
tmp = x / (y * (t - z));
} else if (y <= 1.7e+14) {
tmp = (x / (t - z)) * (-1.0 / z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -1.32e+284: tmp = (x / y) / (t - z) elif y <= -2.2e-16: tmp = x / (y * (t - z)) elif y <= 1.7e+14: tmp = (x / (t - z)) * (-1.0 / z) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.32e+284) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= -2.2e-16) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 1.7e+14) tmp = Float64(Float64(x / Float64(t - z)) * Float64(-1.0 / 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 (y <= -1.32e+284)
tmp = (x / y) / (t - z);
elseif (y <= -2.2e-16)
tmp = x / (y * (t - z));
elseif (y <= 1.7e+14)
tmp = (x / (t - z)) * (-1.0 / 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[y, -1.32e+284], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.2e-16], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+14], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / z), $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}\;y \leq -1.32 \cdot 10^{+284}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq -2.2 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+14}:\\
\;\;\;\;\frac{x}{t - z} \cdot \frac{-1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.32e284Initial program 57.6%
*-un-lft-identity57.6%
times-frac99.6%
*-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 57.6%
associate-/r*99.8%
Simplified99.8%
if -1.32e284 < y < -2.2e-16Initial program 91.8%
Taylor expanded in y around inf 86.9%
*-commutative86.9%
Simplified86.9%
if -2.2e-16 < y < 1.7e14Initial program 90.8%
*-un-lft-identity90.8%
times-frac96.2%
*-commutative96.2%
Applied egg-rr96.2%
Taylor expanded in y around 0 78.7%
if 1.7e14 < y Initial program 84.8%
Taylor expanded in t around inf 56.4%
associate-/r*55.1%
Simplified55.1%
Final simplification74.3%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -8.7e+83)
(- (/ x (* y z)))
(if (or (<= y -4.8e-106) (not (<= y 2150000000000.0)))
(/ (/ x t) y)
(* x (/ (/ -1.0 t) z)))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.7e+83) {
tmp = -(x / (y * z));
} else if ((y <= -4.8e-106) || !(y <= 2150000000000.0)) {
tmp = (x / t) / y;
} else {
tmp = x * ((-1.0 / t) / 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 (y <= (-8.7d+83)) then
tmp = -(x / (y * z))
else if ((y <= (-4.8d-106)) .or. (.not. (y <= 2150000000000.0d0))) then
tmp = (x / t) / y
else
tmp = x * (((-1.0d0) / t) / 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 (y <= -8.7e+83) {
tmp = -(x / (y * z));
} else if ((y <= -4.8e-106) || !(y <= 2150000000000.0)) {
tmp = (x / t) / y;
} else {
tmp = x * ((-1.0 / t) / z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -8.7e+83: tmp = -(x / (y * z)) elif (y <= -4.8e-106) or not (y <= 2150000000000.0): tmp = (x / t) / y else: tmp = x * ((-1.0 / t) / z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -8.7e+83) tmp = Float64(-Float64(x / Float64(y * z))); elseif ((y <= -4.8e-106) || !(y <= 2150000000000.0)) tmp = Float64(Float64(x / t) / y); else tmp = Float64(x * Float64(Float64(-1.0 / t) / z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -8.7e+83)
tmp = -(x / (y * z));
elseif ((y <= -4.8e-106) || ~((y <= 2150000000000.0)))
tmp = (x / t) / y;
else
tmp = x * ((-1.0 / t) / 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[y, -8.7e+83], (-N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), If[Or[LessEqual[y, -4.8e-106], N[Not[LessEqual[y, 2150000000000.0]], $MachinePrecision]], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], N[(x * N[(N[(-1.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.7 \cdot 10^{+83}:\\
\;\;\;\;-\frac{x}{y \cdot z}\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{-106} \lor \neg \left(y \leq 2150000000000\right):\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{-1}{t}}{z}\\
\end{array}
\end{array}
if y < -8.7000000000000005e83Initial program 81.2%
Taylor expanded in t around 0 65.5%
associate-*r/65.5%
neg-mul-165.5%
Simplified65.5%
Taylor expanded in z around 0 65.5%
*-commutative65.5%
Simplified65.5%
if -8.7000000000000005e83 < y < -4.7999999999999995e-106 or 2.15e12 < y Initial program 88.7%
Taylor expanded in z around 0 51.0%
associate-/r*49.5%
Simplified49.5%
if -4.7999999999999995e-106 < y < 2.15e12Initial program 91.1%
Taylor expanded in t around inf 60.2%
associate-/r*57.1%
Simplified57.1%
associate-/l/60.2%
div-inv60.1%
*-commutative60.1%
Applied egg-rr60.1%
Taylor expanded in y around 0 49.1%
associate-/r*49.5%
Simplified49.5%
Final simplification52.1%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -1e+284)
(/ (/ x y) (- t z))
(if (<= y -1.05e-106)
(/ x (* y (- t z)))
(if (<= y 1.7e-188) (/ x (* z (- z t))) (/ (/ x t) (- y z))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1e+284) {
tmp = (x / y) / (t - z);
} else if (y <= -1.05e-106) {
tmp = x / (y * (t - z));
} else if (y <= 1.7e-188) {
tmp = x / (z * (z - t));
} 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 (y <= (-1d+284)) then
tmp = (x / y) / (t - z)
else if (y <= (-1.05d-106)) then
tmp = x / (y * (t - z))
else if (y <= 1.7d-188) then
tmp = x / (z * (z - t))
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 (y <= -1e+284) {
tmp = (x / y) / (t - z);
} else if (y <= -1.05e-106) {
tmp = x / (y * (t - z));
} else if (y <= 1.7e-188) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -1e+284: tmp = (x / y) / (t - z) elif y <= -1.05e-106: tmp = x / (y * (t - z)) elif y <= 1.7e-188: tmp = x / (z * (z - t)) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1e+284) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= -1.05e-106) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 1.7e-188) tmp = Float64(x / Float64(z * Float64(z - t))); 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 (y <= -1e+284)
tmp = (x / y) / (t - z);
elseif (y <= -1.05e-106)
tmp = x / (y * (t - z));
elseif (y <= 1.7e-188)
tmp = x / (z * (z - t));
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[y, -1e+284], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.05e-106], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-188], N[(x / N[(z * N[(z - t), $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}\;y \leq -1 \cdot 10^{+284}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-106}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-188}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.00000000000000008e284Initial program 57.6%
*-un-lft-identity57.6%
times-frac99.6%
*-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 57.6%
associate-/r*99.8%
Simplified99.8%
if -1.00000000000000008e284 < y < -1.05000000000000002e-106Initial program 91.1%
Taylor expanded in y around inf 76.3%
*-commutative76.3%
Simplified76.3%
if -1.05000000000000002e-106 < y < 1.70000000000000014e-188Initial program 93.1%
frac-2neg93.1%
div-inv92.9%
distribute-rgt-neg-in92.9%
Applied egg-rr92.9%
distribute-lft-neg-out92.9%
associate-*r/93.1%
*-rgt-identity93.1%
distribute-neg-frac93.1%
associate-/r*92.3%
neg-sub092.3%
associate--r-92.3%
neg-sub092.3%
Simplified92.3%
Taylor expanded in y around 0 85.2%
if 1.70000000000000014e-188 < y Initial program 85.9%
Taylor expanded in t around inf 54.1%
associate-/r*53.9%
Simplified53.9%
Final simplification69.3%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -1.45e+284)
(/ (/ x y) (- t z))
(if (<= y -3.3e-16)
(/ x (* y (- t z)))
(if (<= y 68000000000000.0) (/ (/ x z) (- z t)) (/ (/ x t) (- y z))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.45e+284) {
tmp = (x / y) / (t - z);
} else if (y <= -3.3e-16) {
tmp = x / (y * (t - z));
} else if (y <= 68000000000000.0) {
tmp = (x / z) / (z - t);
} 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 (y <= (-1.45d+284)) then
tmp = (x / y) / (t - z)
else if (y <= (-3.3d-16)) then
tmp = x / (y * (t - z))
else if (y <= 68000000000000.0d0) then
tmp = (x / z) / (z - t)
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 (y <= -1.45e+284) {
tmp = (x / y) / (t - z);
} else if (y <= -3.3e-16) {
tmp = x / (y * (t - z));
} else if (y <= 68000000000000.0) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -1.45e+284: tmp = (x / y) / (t - z) elif y <= -3.3e-16: tmp = x / (y * (t - z)) elif y <= 68000000000000.0: tmp = (x / z) / (z - t) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.45e+284) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= -3.3e-16) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 68000000000000.0) tmp = Float64(Float64(x / z) / Float64(z - t)); 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 (y <= -1.45e+284)
tmp = (x / y) / (t - z);
elseif (y <= -3.3e-16)
tmp = x / (y * (t - z));
elseif (y <= 68000000000000.0)
tmp = (x / z) / (z - t);
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[y, -1.45e+284], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.3e-16], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 68000000000000.0], N[(N[(x / z), $MachinePrecision] / N[(z - t), $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}\;y \leq -1.45 \cdot 10^{+284}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 68000000000000:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.44999999999999993e284Initial program 57.6%
*-un-lft-identity57.6%
times-frac99.6%
*-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 57.6%
associate-/r*99.8%
Simplified99.8%
if -1.44999999999999993e284 < y < -3.29999999999999988e-16Initial program 91.8%
Taylor expanded in y around inf 86.9%
*-commutative86.9%
Simplified86.9%
if -3.29999999999999988e-16 < y < 6.8e13Initial program 90.8%
frac-2neg90.8%
div-inv90.6%
distribute-rgt-neg-in90.6%
Applied egg-rr90.6%
distribute-lft-neg-out90.6%
associate-*r/90.8%
*-rgt-identity90.8%
distribute-neg-frac90.8%
associate-/r*94.1%
neg-sub094.1%
associate--r-94.1%
neg-sub094.1%
Simplified94.1%
Taylor expanded in y around 0 79.0%
if 6.8e13 < y Initial program 85.0%
Taylor expanded in t around inf 55.7%
associate-/r*54.3%
Simplified54.3%
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 (<= y -7.5e+82)
(- (/ x (* y z)))
(if (or (<= y -1.15e-101) (not (<= y 2200000000000.0)))
(/ (/ x t) y)
(/ (- x) (* z t)))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e+82) {
tmp = -(x / (y * z));
} else if ((y <= -1.15e-101) || !(y <= 2200000000000.0)) {
tmp = (x / t) / y;
} else {
tmp = -x / (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 <= (-7.5d+82)) then
tmp = -(x / (y * z))
else if ((y <= (-1.15d-101)) .or. (.not. (y <= 2200000000000.0d0))) then
tmp = (x / t) / y
else
tmp = -x / (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 <= -7.5e+82) {
tmp = -(x / (y * z));
} else if ((y <= -1.15e-101) || !(y <= 2200000000000.0)) {
tmp = (x / t) / y;
} else {
tmp = -x / (z * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -7.5e+82: tmp = -(x / (y * z)) elif (y <= -1.15e-101) or not (y <= 2200000000000.0): tmp = (x / t) / y else: tmp = -x / (z * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -7.5e+82) tmp = Float64(-Float64(x / Float64(y * z))); elseif ((y <= -1.15e-101) || !(y <= 2200000000000.0)) tmp = Float64(Float64(x / t) / y); else tmp = Float64(Float64(-x) / Float64(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 <= -7.5e+82)
tmp = -(x / (y * z));
elseif ((y <= -1.15e-101) || ~((y <= 2200000000000.0)))
tmp = (x / t) / y;
else
tmp = -x / (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, -7.5e+82], (-N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), If[Or[LessEqual[y, -1.15e-101], N[Not[LessEqual[y, 2200000000000.0]], $MachinePrecision]], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+82}:\\
\;\;\;\;-\frac{x}{y \cdot z}\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{-101} \lor \neg \left(y \leq 2200000000000\right):\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\end{array}
\end{array}
if y < -7.4999999999999999e82Initial program 81.2%
Taylor expanded in t around 0 65.5%
associate-*r/65.5%
neg-mul-165.5%
Simplified65.5%
Taylor expanded in z around 0 65.5%
*-commutative65.5%
Simplified65.5%
if -7.4999999999999999e82 < y < -1.15e-101 or 2.2e12 < y Initial program 88.7%
Taylor expanded in z around 0 51.4%
associate-/r*49.9%
Simplified49.9%
if -1.15e-101 < y < 2.2e12Initial program 91.1%
Taylor expanded in t around inf 60.5%
associate-/r*57.6%
Simplified57.6%
Taylor expanded in y around 0 49.7%
associate-*r/49.7%
neg-mul-149.7%
Simplified49.7%
Final simplification52.3%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -0.0245) (not (<= z 1.05e-71))) (/ x (* z (- z t))) (/ x (* (- y z) t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.0245) || !(z <= 1.05e-71)) {
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 ((z <= (-0.0245d0)) .or. (.not. (z <= 1.05d-71))) 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 ((z <= -0.0245) || !(z <= 1.05e-71)) {
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 (z <= -0.0245) or not (z <= 1.05e-71): 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 ((z <= -0.0245) || !(z <= 1.05e-71)) 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 ((z <= -0.0245) || ~((z <= 1.05e-71)))
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[Or[LessEqual[z, -0.0245], N[Not[LessEqual[z, 1.05e-71]], $MachinePrecision]], 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}\;z \leq -0.0245 \lor \neg \left(z \leq 1.05 \cdot 10^{-71}\right):\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if z < -0.024500000000000001 or 1.0500000000000001e-71 < z Initial program 81.8%
frac-2neg81.8%
div-inv81.7%
distribute-rgt-neg-in81.7%
Applied egg-rr81.7%
distribute-lft-neg-out81.7%
associate-*r/81.8%
*-rgt-identity81.8%
distribute-neg-frac81.8%
associate-/r*99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
Simplified99.8%
Taylor expanded in y around 0 66.2%
if -0.024500000000000001 < z < 1.0500000000000001e-71Initial program 97.1%
Taylor expanded in t around inf 77.0%
Final simplification70.8%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -2.1e-90) (/ (/ x y) t) (if (<= t 6.2e-187) (- (/ x (* y z))) (/ x (* (- y z) t)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.1e-90) {
tmp = (x / y) / t;
} else if (t <= 6.2e-187) {
tmp = -(x / (y * 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 (t <= (-2.1d-90)) then
tmp = (x / y) / t
else if (t <= 6.2d-187) then
tmp = -(x / (y * 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 (t <= -2.1e-90) {
tmp = (x / y) / t;
} else if (t <= 6.2e-187) {
tmp = -(x / (y * z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= -2.1e-90: tmp = (x / y) / t elif t <= 6.2e-187: tmp = -(x / (y * z)) else: tmp = x / ((y - z) * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -2.1e-90) tmp = Float64(Float64(x / y) / t); elseif (t <= 6.2e-187) tmp = Float64(-Float64(x / Float64(y * 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 (t <= -2.1e-90)
tmp = (x / y) / t;
elseif (t <= 6.2e-187)
tmp = -(x / (y * 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[t, -2.1e-90], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 6.2e-187], (-N[(x / N[(y * 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}\;t \leq -2.1 \cdot 10^{-90}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-187}:\\
\;\;\;\;-\frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -2.0999999999999999e-90Initial program 90.1%
Taylor expanded in z around 0 51.5%
*-un-lft-identity51.5%
times-frac52.1%
Applied egg-rr52.1%
associate-*l/52.1%
*-un-lft-identity52.1%
Applied egg-rr52.1%
if -2.0999999999999999e-90 < t < 6.20000000000000039e-187Initial program 89.1%
Taylor expanded in t around 0 84.1%
associate-*r/84.1%
neg-mul-184.1%
Simplified84.1%
Taylor expanded in z around 0 54.2%
*-commutative54.2%
Simplified54.2%
if 6.20000000000000039e-187 < t Initial program 86.2%
Taylor expanded in t around inf 64.1%
Final simplification57.1%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.06e-106) (/ x (* y (- t z))) (if (<= y 2.5e-34) (/ 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 <= -1.06e-106) {
tmp = x / (y * (t - z));
} else if (y <= 2.5e-34) {
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 <= (-1.06d-106)) then
tmp = x / (y * (t - z))
else if (y <= 2.5d-34) 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 <= -1.06e-106) {
tmp = x / (y * (t - z));
} else if (y <= 2.5e-34) {
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 <= -1.06e-106: tmp = x / (y * (t - z)) elif y <= 2.5e-34: 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 <= -1.06e-106) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 2.5e-34) 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 <= -1.06e-106)
tmp = x / (y * (t - z));
elseif (y <= 2.5e-34)
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, -1.06e-106], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e-34], 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 -1.06 \cdot 10^{-106}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-34}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -1.06e-106Initial program 88.3%
Taylor expanded in y around inf 74.7%
*-commutative74.7%
Simplified74.7%
if -1.06e-106 < y < 2.5000000000000001e-34Initial program 91.5%
frac-2neg91.5%
div-inv91.3%
distribute-rgt-neg-in91.3%
Applied egg-rr91.3%
distribute-lft-neg-out91.3%
associate-*r/91.5%
*-rgt-identity91.5%
distribute-neg-frac91.5%
associate-/r*93.6%
neg-sub093.6%
associate--r-93.6%
neg-sub093.6%
Simplified93.6%
Taylor expanded in y around 0 79.7%
if 2.5000000000000001e-34 < y Initial program 85.1%
Taylor expanded in t around inf 56.0%
Final simplification70.4%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.06e-106) (/ x (* y (- t z))) (if (<= y 1.7e-188) (/ x (* z (- z t))) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.06e-106) {
tmp = x / (y * (t - z));
} else if (y <= 1.7e-188) {
tmp = x / (z * (z - t));
} 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 (y <= (-1.06d-106)) then
tmp = x / (y * (t - z))
else if (y <= 1.7d-188) then
tmp = x / (z * (z - t))
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 (y <= -1.06e-106) {
tmp = x / (y * (t - z));
} else if (y <= 1.7e-188) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -1.06e-106: tmp = x / (y * (t - z)) elif y <= 1.7e-188: tmp = x / (z * (z - t)) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.06e-106) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 1.7e-188) tmp = Float64(x / Float64(z * Float64(z - t))); 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 (y <= -1.06e-106)
tmp = x / (y * (t - z));
elseif (y <= 1.7e-188)
tmp = x / (z * (z - t));
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[y, -1.06e-106], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-188], N[(x / N[(z * N[(z - t), $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}\;y \leq -1.06 \cdot 10^{-106}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-188}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.06e-106Initial program 88.3%
Taylor expanded in y around inf 74.7%
*-commutative74.7%
Simplified74.7%
if -1.06e-106 < y < 1.70000000000000014e-188Initial program 93.1%
frac-2neg93.1%
div-inv92.9%
distribute-rgt-neg-in92.9%
Applied egg-rr92.9%
distribute-lft-neg-out92.9%
associate-*r/93.1%
*-rgt-identity93.1%
distribute-neg-frac93.1%
associate-/r*92.3%
neg-sub092.3%
associate--r-92.3%
neg-sub092.3%
Simplified92.3%
Taylor expanded in y around 0 85.2%
if 1.70000000000000014e-188 < y Initial program 85.9%
Taylor expanded in t around inf 54.1%
associate-/r*53.9%
Simplified53.9%
Final simplification68.2%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -3e-83) (/ (/ x y) t) (if (<= y 3000000000000.0) (/ (- x) (* z t)) (/ (/ x t) y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3e-83) {
tmp = (x / y) / t;
} else if (y <= 3000000000000.0) {
tmp = -x / (z * t);
} else {
tmp = (x / t) / 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 (y <= (-3d-83)) then
tmp = (x / y) / t
else if (y <= 3000000000000.0d0) then
tmp = -x / (z * t)
else
tmp = (x / t) / 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 (y <= -3e-83) {
tmp = (x / y) / t;
} else if (y <= 3000000000000.0) {
tmp = -x / (z * t);
} else {
tmp = (x / t) / y;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -3e-83: tmp = (x / y) / t elif y <= 3000000000000.0: tmp = -x / (z * t) else: tmp = (x / t) / y return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -3e-83) tmp = Float64(Float64(x / y) / t); elseif (y <= 3000000000000.0) tmp = Float64(Float64(-x) / Float64(z * t)); else tmp = Float64(Float64(x / t) / y); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -3e-83)
tmp = (x / y) / t;
elseif (y <= 3000000000000.0)
tmp = -x / (z * t);
else
tmp = (x / t) / 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[LessEqual[y, -3e-83], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 3000000000000.0], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-83}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;y \leq 3000000000000:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if y < -3.0000000000000001e-83Initial program 88.0%
Taylor expanded in z around 0 40.4%
*-un-lft-identity40.4%
times-frac44.5%
Applied egg-rr44.5%
associate-*l/44.6%
*-un-lft-identity44.6%
Applied egg-rr44.6%
if -3.0000000000000001e-83 < y < 3e12Initial program 91.3%
Taylor expanded in t around inf 59.4%
associate-/r*56.5%
Simplified56.5%
Taylor expanded in y around 0 48.7%
associate-*r/48.7%
neg-mul-148.7%
Simplified48.7%
if 3e12 < y Initial program 85.0%
Taylor expanded in z around 0 53.0%
associate-/r*50.7%
Simplified50.7%
Final simplification48.0%
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.85e+48) (not (<= z 3.9e-14))) (/ x (* y z)) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.85e+48) || !(z <= 3.9e-14)) {
tmp = x / (y * 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 <= (-2.85d+48)) .or. (.not. (z <= 3.9d-14))) then
tmp = x / (y * 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 <= -2.85e+48) || !(z <= 3.9e-14)) {
tmp = x / (y * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -2.85e+48) or not (z <= 3.9e-14): tmp = x / (y * z) else: tmp = x / (y * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -2.85e+48) || !(z <= 3.9e-14)) tmp = Float64(x / Float64(y * 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 <= -2.85e+48) || ~((z <= 3.9e-14)))
tmp = x / (y * 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, -2.85e+48], N[Not[LessEqual[z, 3.9e-14]], $MachinePrecision]], N[(x / N[(y * 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 -2.85 \cdot 10^{+48} \lor \neg \left(z \leq 3.9 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -2.84999999999999984e48 or 3.8999999999999998e-14 < z Initial program 79.3%
Taylor expanded in y around inf 45.4%
*-commutative45.4%
Simplified45.4%
Taylor expanded in t around 0 42.5%
associate-/r*43.9%
associate-*r/43.9%
mul-1-neg43.9%
Simplified43.9%
distribute-frac-neg43.9%
neg-sub043.9%
add-sqr-sqrt29.7%
sqrt-unprod39.4%
sqr-neg39.4%
sqrt-unprod18.3%
add-sqr-sqrt33.9%
distribute-frac-neg33.9%
neg-sub033.9%
add-sqr-sqrt23.2%
sqrt-unprod37.8%
sqr-neg37.8%
sqrt-unprod21.7%
add-sqr-sqrt43.9%
associate--r-43.9%
metadata-eval43.9%
Applied egg-rr37.4%
+-lft-identity37.4%
Simplified37.4%
if -2.84999999999999984e48 < z < 3.8999999999999998e-14Initial program 96.2%
Taylor expanded in z around 0 51.2%
Final simplification44.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 -2.8e+76) (not (<= z 2.45e+165))) (/ x (* y z)) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.8e+76) || !(z <= 2.45e+165)) {
tmp = x / (y * z);
} else {
tmp = (x / t) / 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 <= (-2.8d+76)) .or. (.not. (z <= 2.45d+165))) then
tmp = x / (y * z)
else
tmp = (x / t) / 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 <= -2.8e+76) || !(z <= 2.45e+165)) {
tmp = x / (y * z);
} else {
tmp = (x / t) / y;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -2.8e+76) or not (z <= 2.45e+165): tmp = x / (y * z) else: tmp = (x / t) / y return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -2.8e+76) || !(z <= 2.45e+165)) tmp = Float64(x / Float64(y * z)); else tmp = Float64(Float64(x / t) / y); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -2.8e+76) || ~((z <= 2.45e+165)))
tmp = x / (y * z);
else
tmp = (x / t) / 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, -2.8e+76], N[Not[LessEqual[z, 2.45e+165]], $MachinePrecision]], N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+76} \lor \neg \left(z \leq 2.45 \cdot 10^{+165}\right):\\
\;\;\;\;\frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -2.7999999999999999e76 or 2.44999999999999993e165 < z Initial program 73.0%
Taylor expanded in y around inf 41.6%
*-commutative41.6%
Simplified41.6%
Taylor expanded in t around 0 41.5%
associate-/r*42.2%
associate-*r/42.2%
mul-1-neg42.2%
Simplified42.2%
distribute-frac-neg42.2%
neg-sub042.2%
add-sqr-sqrt29.8%
sqrt-unprod40.7%
sqr-neg40.7%
sqrt-unprod16.4%
add-sqr-sqrt36.3%
distribute-frac-neg36.3%
neg-sub036.3%
add-sqr-sqrt23.9%
sqrt-unprod36.0%
sqr-neg36.0%
sqrt-unprod16.4%
add-sqr-sqrt42.2%
associate--r-42.2%
metadata-eval42.2%
Applied egg-rr41.7%
+-lft-identity41.7%
Simplified41.7%
if -2.7999999999999999e76 < z < 2.44999999999999993e165Initial program 94.7%
Taylor expanded in z around 0 43.7%
associate-/r*46.4%
Simplified46.4%
Final simplification45.0%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -2.9e+80) (/ x (* y z)) (if (<= z 3.6e+48) (/ (/ x t) y) (/ (/ x z) y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.9e+80) {
tmp = x / (y * z);
} else if (z <= 3.6e+48) {
tmp = (x / t) / y;
} else {
tmp = (x / z) / 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 <= (-2.9d+80)) then
tmp = x / (y * z)
else if (z <= 3.6d+48) then
tmp = (x / t) / y
else
tmp = (x / z) / 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 <= -2.9e+80) {
tmp = x / (y * z);
} else if (z <= 3.6e+48) {
tmp = (x / t) / y;
} else {
tmp = (x / z) / y;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -2.9e+80: tmp = x / (y * z) elif z <= 3.6e+48: tmp = (x / t) / y else: tmp = (x / z) / y return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -2.9e+80) tmp = Float64(x / Float64(y * z)); elseif (z <= 3.6e+48) tmp = Float64(Float64(x / t) / y); else tmp = Float64(Float64(x / z) / y); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -2.9e+80)
tmp = x / (y * z);
elseif (z <= 3.6e+48)
tmp = (x / t) / y;
else
tmp = (x / z) / 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[LessEqual[z, -2.9e+80], N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+48], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+80}:\\
\;\;\;\;\frac{x}{y \cdot z}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+48}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{y}\\
\end{array}
\end{array}
if z < -2.89999999999999986e80Initial program 75.5%
Taylor expanded in y around inf 44.0%
*-commutative44.0%
Simplified44.0%
Taylor expanded in t around 0 43.9%
associate-/r*42.9%
associate-*r/42.9%
mul-1-neg42.9%
Simplified42.9%
distribute-frac-neg42.9%
neg-sub042.9%
add-sqr-sqrt31.9%
sqrt-unprod40.8%
sqr-neg40.8%
sqrt-unprod15.6%
add-sqr-sqrt34.9%
distribute-frac-neg34.9%
neg-sub034.9%
add-sqr-sqrt23.9%
sqrt-unprod34.6%
sqr-neg34.6%
sqrt-unprod15.5%
add-sqr-sqrt42.9%
associate--r-42.9%
metadata-eval42.9%
Applied egg-rr44.1%
+-lft-identity44.1%
Simplified44.1%
if -2.89999999999999986e80 < z < 3.59999999999999983e48Initial program 95.4%
Taylor expanded in z around 0 47.4%
associate-/r*48.7%
Simplified48.7%
if 3.59999999999999983e48 < z Initial program 78.2%
Taylor expanded in y around inf 41.8%
*-commutative41.8%
Simplified41.8%
Taylor expanded in t around 0 40.0%
associate-/r*42.2%
associate-*r/42.2%
mul-1-neg42.2%
Simplified42.2%
distribute-frac-neg42.2%
neg-sub042.2%
add-sqr-sqrt27.2%
sqrt-unprod39.4%
sqr-neg39.4%
sqrt-unprod18.4%
add-sqr-sqrt36.6%
distribute-frac-neg36.6%
neg-sub036.6%
add-sqr-sqrt25.7%
sqrt-unprod41.5%
sqr-neg41.5%
sqrt-unprod22.5%
add-sqr-sqrt42.2%
associate--r-42.2%
metadata-eval42.2%
Applied egg-rr36.8%
+-lft-identity36.8%
Simplified36.8%
Taylor expanded in x around 0 36.8%
*-commutative36.8%
associate-/r*43.7%
Simplified43.7%
Final simplification46.9%
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 88.4%
Taylor expanded in z around 0 35.6%
Final simplification35.6%
(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 2023301
(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))))