
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
NOTE: 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 (or (<= t_1 -2e+295) (not (<= t_1 2e+193)))
(/ (/ x (- y z)) (- t z))
(/ x t_1))))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+295) || !(t_1 <= 2e+193)) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x / t_1;
}
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+295)) .or. (.not. (t_1 <= 2d+193))) then
tmp = (x / (y - z)) / (t - z)
else
tmp = x / t_1
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+295) || !(t_1 <= 2e+193)) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x / t_1;
}
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+295) or not (t_1 <= 2e+193): tmp = (x / (y - z)) / (t - z) else: tmp = x / t_1 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+295) || !(t_1 <= 2e+193)) tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); else tmp = Float64(x / t_1); 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+295) || ~((t_1 <= 2e+193)))
tmp = (x / (y - z)) / (t - z);
else
tmp = x / t_1;
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[Or[LessEqual[t$95$1, -2e+295], N[Not[LessEqual[t$95$1, 2e+193]], $MachinePrecision]], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / t$95$1), $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^{+295} \lor \neg \left(t_1 \leq 2 \cdot 10^{+193}\right):\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t_1}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -2e295 or 2.00000000000000013e193 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 81.1%
*-un-lft-identity81.1%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 81.1%
associate-/l/99.9%
Simplified99.9%
if -2e295 < (*.f64 (-.f64 y z) (-.f64 t z)) < 2.00000000000000013e193Initial program 98.9%
Final simplification99.4%
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 t) y)))
(if (<= t -2.15e-47)
t_1
(if (<= t 1.55e-16)
(/ (- x) (* y z))
(if (<= t 3.2e+143)
(/ (- x) (* z t))
(if (<= t 2.5e+171) t_1 (/ (/ (- x) t) z)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / t) / y;
double tmp;
if (t <= -2.15e-47) {
tmp = t_1;
} else if (t <= 1.55e-16) {
tmp = -x / (y * z);
} else if (t <= 3.2e+143) {
tmp = -x / (z * t);
} else if (t <= 2.5e+171) {
tmp = t_1;
} else {
tmp = (-x / 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) :: t_1
real(8) :: tmp
t_1 = (x / t) / y
if (t <= (-2.15d-47)) then
tmp = t_1
else if (t <= 1.55d-16) then
tmp = -x / (y * z)
else if (t <= 3.2d+143) then
tmp = -x / (z * t)
else if (t <= 2.5d+171) then
tmp = t_1
else
tmp = (-x / t) / 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 / t) / y;
double tmp;
if (t <= -2.15e-47) {
tmp = t_1;
} else if (t <= 1.55e-16) {
tmp = -x / (y * z);
} else if (t <= 3.2e+143) {
tmp = -x / (z * t);
} else if (t <= 2.5e+171) {
tmp = t_1;
} else {
tmp = (-x / t) / z;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / t) / y tmp = 0 if t <= -2.15e-47: tmp = t_1 elif t <= 1.55e-16: tmp = -x / (y * z) elif t <= 3.2e+143: tmp = -x / (z * t) elif t <= 2.5e+171: tmp = t_1 else: tmp = (-x / t) / z return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / t) / y) tmp = 0.0 if (t <= -2.15e-47) tmp = t_1; elseif (t <= 1.55e-16) tmp = Float64(Float64(-x) / Float64(y * z)); elseif (t <= 3.2e+143) tmp = Float64(Float64(-x) / Float64(z * t)); elseif (t <= 2.5e+171) tmp = t_1; else tmp = Float64(Float64(Float64(-x) / t) / z); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / t) / y;
tmp = 0.0;
if (t <= -2.15e-47)
tmp = t_1;
elseif (t <= 1.55e-16)
tmp = -x / (y * z);
elseif (t <= 3.2e+143)
tmp = -x / (z * t);
elseif (t <= 2.5e+171)
tmp = t_1;
else
tmp = (-x / 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_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, -2.15e-47], t$95$1, If[LessEqual[t, 1.55e-16], N[((-x) / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e+143], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e+171], t$95$1, N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{t}}{y}\\
\mathbf{if}\;t \leq -2.15 \cdot 10^{-47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-16}:\\
\;\;\;\;\frac{-x}{y \cdot z}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+143}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+171}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-x}{t}}{z}\\
\end{array}
\end{array}
if t < -2.1499999999999999e-47 or 3.20000000000000016e143 < t < 2.5000000000000002e171Initial program 82.0%
Taylor expanded in z around 0 51.0%
div-inv51.0%
associate-/r*50.9%
Applied egg-rr50.9%
associate-*r/60.8%
div-inv60.8%
Applied egg-rr60.8%
if -2.1499999999999999e-47 < t < 1.55e-16Initial program 92.5%
Taylor expanded in z around 0 62.3%
distribute-lft-out62.3%
mul-1-neg62.3%
distribute-rgt-neg-in62.3%
unsub-neg62.3%
Simplified62.3%
Taylor expanded in t around 0 44.4%
associate-*r/44.4%
neg-mul-144.4%
*-commutative44.4%
Simplified44.4%
if 1.55e-16 < t < 3.20000000000000016e143Initial program 99.9%
Taylor expanded in y around 0 63.6%
associate-*r/63.6%
neg-mul-163.6%
Simplified63.6%
Taylor expanded in z around 0 53.4%
associate-*r/53.4%
neg-mul-153.4%
*-commutative53.4%
Simplified53.4%
if 2.5000000000000002e171 < t Initial program 83.1%
*-un-lft-identity83.1%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 96.8%
Taylor expanded in y around 0 80.0%
associate-*l/80.1%
neg-mul-180.1%
distribute-neg-frac80.1%
Applied egg-rr80.1%
Final simplification54.8%
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 t) y)))
(if (<= t -2.15e-44)
t_1
(if (<= t 8e-14)
(/ (/ (- x) z) y)
(if (<= t 8e+143)
(/ (- x) (* z t))
(if (<= t 1.8e+171) t_1 (/ (/ (- x) t) z)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / t) / y;
double tmp;
if (t <= -2.15e-44) {
tmp = t_1;
} else if (t <= 8e-14) {
tmp = (-x / z) / y;
} else if (t <= 8e+143) {
tmp = -x / (z * t);
} else if (t <= 1.8e+171) {
tmp = t_1;
} else {
tmp = (-x / 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) :: t_1
real(8) :: tmp
t_1 = (x / t) / y
if (t <= (-2.15d-44)) then
tmp = t_1
else if (t <= 8d-14) then
tmp = (-x / z) / y
else if (t <= 8d+143) then
tmp = -x / (z * t)
else if (t <= 1.8d+171) then
tmp = t_1
else
tmp = (-x / t) / 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 / t) / y;
double tmp;
if (t <= -2.15e-44) {
tmp = t_1;
} else if (t <= 8e-14) {
tmp = (-x / z) / y;
} else if (t <= 8e+143) {
tmp = -x / (z * t);
} else if (t <= 1.8e+171) {
tmp = t_1;
} else {
tmp = (-x / t) / z;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / t) / y tmp = 0 if t <= -2.15e-44: tmp = t_1 elif t <= 8e-14: tmp = (-x / z) / y elif t <= 8e+143: tmp = -x / (z * t) elif t <= 1.8e+171: tmp = t_1 else: tmp = (-x / t) / z return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / t) / y) tmp = 0.0 if (t <= -2.15e-44) tmp = t_1; elseif (t <= 8e-14) tmp = Float64(Float64(Float64(-x) / z) / y); elseif (t <= 8e+143) tmp = Float64(Float64(-x) / Float64(z * t)); elseif (t <= 1.8e+171) tmp = t_1; else tmp = Float64(Float64(Float64(-x) / t) / z); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / t) / y;
tmp = 0.0;
if (t <= -2.15e-44)
tmp = t_1;
elseif (t <= 8e-14)
tmp = (-x / z) / y;
elseif (t <= 8e+143)
tmp = -x / (z * t);
elseif (t <= 1.8e+171)
tmp = t_1;
else
tmp = (-x / 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_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, -2.15e-44], t$95$1, If[LessEqual[t, 8e-14], N[(N[((-x) / z), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 8e+143], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e+171], t$95$1, N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{t}}{y}\\
\mathbf{if}\;t \leq -2.15 \cdot 10^{-44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-14}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y}\\
\mathbf{elif}\;t \leq 8 \cdot 10^{+143}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{+171}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-x}{t}}{z}\\
\end{array}
\end{array}
if t < -2.15000000000000007e-44 or 8.0000000000000002e143 < t < 1.80000000000000009e171Initial program 82.0%
Taylor expanded in z around 0 51.0%
div-inv51.0%
associate-/r*50.9%
Applied egg-rr50.9%
associate-*r/60.8%
div-inv60.8%
Applied egg-rr60.8%
if -2.15000000000000007e-44 < t < 7.99999999999999999e-14Initial program 92.5%
Taylor expanded in y around inf 60.2%
*-commutative60.2%
associate-/r*65.8%
Simplified65.8%
Taylor expanded in t around 0 50.8%
associate-*r/50.8%
neg-mul-150.8%
Simplified50.8%
if 7.99999999999999999e-14 < t < 8.0000000000000002e143Initial program 99.9%
Taylor expanded in y around 0 63.6%
associate-*r/63.6%
neg-mul-163.6%
Simplified63.6%
Taylor expanded in z around 0 53.4%
associate-*r/53.4%
neg-mul-153.4%
*-commutative53.4%
Simplified53.4%
if 1.80000000000000009e171 < t Initial program 83.1%
*-un-lft-identity83.1%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 96.8%
Taylor expanded in y around 0 80.0%
associate-*l/80.1%
neg-mul-180.1%
distribute-neg-frac80.1%
Applied egg-rr80.1%
Final simplification57.5%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t -1.2e-183)
(/ (/ x (- t z)) y)
(if (<= t 1.75e-6)
(/ (/ (- x) z) (- y z))
(if (<= t 4.5e+185) (/ 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.2e-183) {
tmp = (x / (t - z)) / y;
} else if (t <= 1.75e-6) {
tmp = (-x / z) / (y - z);
} else if (t <= 4.5e+185) {
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.2d-183)) then
tmp = (x / (t - z)) / y
else if (t <= 1.75d-6) then
tmp = (-x / z) / (y - z)
else if (t <= 4.5d+185) 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.2e-183) {
tmp = (x / (t - z)) / y;
} else if (t <= 1.75e-6) {
tmp = (-x / z) / (y - z);
} else if (t <= 4.5e+185) {
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.2e-183: tmp = (x / (t - z)) / y elif t <= 1.75e-6: tmp = (-x / z) / (y - z) elif t <= 4.5e+185: 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.2e-183) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (t <= 1.75e-6) tmp = Float64(Float64(Float64(-x) / z) / Float64(y - z)); elseif (t <= 4.5e+185) 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.2e-183)
tmp = (x / (t - z)) / y;
elseif (t <= 1.75e-6)
tmp = (-x / z) / (y - z);
elseif (t <= 4.5e+185)
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.2e-183], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 1.75e-6], N[(N[((-x) / z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e+185], 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.2 \cdot 10^{-183}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y - z}\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+185}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.19999999999999996e-183Initial program 85.3%
Taylor expanded in y around inf 59.1%
*-commutative59.1%
associate-/r*68.3%
Simplified68.3%
if -1.19999999999999996e-183 < t < 1.74999999999999997e-6Initial program 93.1%
*-un-lft-identity93.1%
times-frac97.4%
Applied egg-rr97.4%
Taylor expanded in t around 0 80.8%
mul-1-neg80.8%
associate-/r*85.0%
Simplified85.0%
if 1.74999999999999997e-6 < t < 4.5000000000000002e185Initial program 97.9%
Taylor expanded in t around inf 91.2%
if 4.5000000000000002e185 < t Initial program 81.8%
*-un-lft-identity81.8%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 99.9%
associate-*l/99.9%
*-un-lft-identity99.9%
Applied egg-rr99.9%
Final simplification80.9%
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 t) y)))
(if (<= t -6.2e-50)
t_1
(if (<= t 5.3e-14)
(/ (- x) (* y z))
(if (<= t 1.36e+143) (/ (- x) (* z t)) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / t) / y;
double tmp;
if (t <= -6.2e-50) {
tmp = t_1;
} else if (t <= 5.3e-14) {
tmp = -x / (y * z);
} else if (t <= 1.36e+143) {
tmp = -x / (z * t);
} else {
tmp = t_1;
}
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 / t) / y
if (t <= (-6.2d-50)) then
tmp = t_1
else if (t <= 5.3d-14) then
tmp = -x / (y * z)
else if (t <= 1.36d+143) then
tmp = -x / (z * t)
else
tmp = t_1
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 / t) / y;
double tmp;
if (t <= -6.2e-50) {
tmp = t_1;
} else if (t <= 5.3e-14) {
tmp = -x / (y * z);
} else if (t <= 1.36e+143) {
tmp = -x / (z * t);
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / t) / y tmp = 0 if t <= -6.2e-50: tmp = t_1 elif t <= 5.3e-14: tmp = -x / (y * z) elif t <= 1.36e+143: tmp = -x / (z * t) else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / t) / y) tmp = 0.0 if (t <= -6.2e-50) tmp = t_1; elseif (t <= 5.3e-14) tmp = Float64(Float64(-x) / Float64(y * z)); elseif (t <= 1.36e+143) tmp = Float64(Float64(-x) / Float64(z * t)); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / t) / y;
tmp = 0.0;
if (t <= -6.2e-50)
tmp = t_1;
elseif (t <= 5.3e-14)
tmp = -x / (y * z);
elseif (t <= 1.36e+143)
tmp = -x / (z * t);
else
tmp = t_1;
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[(x / t), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, -6.2e-50], t$95$1, If[LessEqual[t, 5.3e-14], N[((-x) / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.36e+143], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{t}}{y}\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{-50}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.3 \cdot 10^{-14}:\\
\;\;\;\;\frac{-x}{y \cdot z}\\
\mathbf{elif}\;t \leq 1.36 \cdot 10^{+143}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -6.2000000000000004e-50 or 1.3599999999999999e143 < t Initial program 82.5%
Taylor expanded in z around 0 49.5%
div-inv49.5%
associate-/r*49.4%
Applied egg-rr49.4%
associate-*r/63.8%
div-inv63.8%
Applied egg-rr63.8%
if -6.2000000000000004e-50 < t < 5.3000000000000001e-14Initial program 92.5%
Taylor expanded in z around 0 62.0%
distribute-lft-out62.0%
mul-1-neg62.0%
distribute-rgt-neg-in62.0%
unsub-neg62.0%
Simplified62.0%
Taylor expanded in t around 0 44.8%
associate-*r/44.8%
neg-mul-144.8%
*-commutative44.8%
Simplified44.8%
if 5.3000000000000001e-14 < t < 1.3599999999999999e143Initial program 99.9%
Taylor expanded in y around 0 63.6%
associate-*r/63.6%
neg-mul-163.6%
Simplified63.6%
Taylor expanded in z around 0 53.4%
associate-*r/53.4%
neg-mul-153.4%
*-commutative53.4%
Simplified53.4%
Final simplification54.1%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= t -1.46e-52) (not (<= t 9.8e-135))) (/ x (* (- y z) t)) (/ (/ (- x) z) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.46e-52) || !(t <= 9.8e-135)) {
tmp = x / ((y - z) * t);
} 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 ((t <= (-1.46d-52)) .or. (.not. (t <= 9.8d-135))) then
tmp = x / ((y - z) * t)
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 ((t <= -1.46e-52) || !(t <= 9.8e-135)) {
tmp = x / ((y - z) * t);
} else {
tmp = (-x / z) / y;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (t <= -1.46e-52) or not (t <= 9.8e-135): tmp = x / ((y - z) * t) else: tmp = (-x / z) / y return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((t <= -1.46e-52) || !(t <= 9.8e-135)) tmp = Float64(x / Float64(Float64(y - z) * t)); else tmp = Float64(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 ((t <= -1.46e-52) || ~((t <= 9.8e-135)))
tmp = x / ((y - z) * t);
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[Or[LessEqual[t, -1.46e-52], N[Not[LessEqual[t, 9.8e-135]], $MachinePrecision]], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / z), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.46 \cdot 10^{-52} \lor \neg \left(t \leq 9.8 \cdot 10^{-135}\right):\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y}\\
\end{array}
\end{array}
if t < -1.46000000000000003e-52 or 9.8000000000000005e-135 < t Initial program 87.8%
Taylor expanded in t around inf 76.4%
if -1.46000000000000003e-52 < t < 9.8000000000000005e-135Initial program 93.1%
Taylor expanded in y around inf 58.6%
*-commutative58.6%
associate-/r*63.2%
Simplified63.2%
Taylor expanded in t around 0 53.3%
associate-*r/53.3%
neg-mul-153.3%
Simplified53.3%
Final simplification68.4%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 2.35e-78) (/ x (* y (- t z))) (if (<= t 2.1e+185) (/ 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 <= 2.35e-78) {
tmp = x / (y * (t - z));
} else if (t <= 2.1e+185) {
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 <= 2.35d-78) then
tmp = x / (y * (t - z))
else if (t <= 2.1d+185) 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 <= 2.35e-78) {
tmp = x / (y * (t - z));
} else if (t <= 2.1e+185) {
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 <= 2.35e-78: tmp = x / (y * (t - z)) elif t <= 2.1e+185: 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 <= 2.35e-78) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (t <= 2.1e+185) 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 <= 2.35e-78)
tmp = x / (y * (t - z));
elseif (t <= 2.1e+185)
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, 2.35e-78], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e+185], 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 2.35 \cdot 10^{-78}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{+185}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 2.34999999999999985e-78Initial program 88.3%
Taylor expanded in y around inf 59.1%
*-commutative59.1%
Simplified59.1%
if 2.34999999999999985e-78 < t < 2.1e185Initial program 96.9%
Taylor expanded in t around inf 77.6%
if 2.1e185 < t Initial program 81.8%
*-un-lft-identity81.8%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 99.9%
associate-*l/99.9%
*-un-lft-identity99.9%
Applied egg-rr99.9%
Final simplification67.8%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 1.1e-14) (/ (/ x (- t z)) y) (if (<= t 2.25e+185) (/ 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.1e-14) {
tmp = (x / (t - z)) / y;
} else if (t <= 2.25e+185) {
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.1d-14) then
tmp = (x / (t - z)) / y
else if (t <= 2.25d+185) 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.1e-14) {
tmp = (x / (t - z)) / y;
} else if (t <= 2.25e+185) {
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.1e-14: tmp = (x / (t - z)) / y elif t <= 2.25e+185: 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.1e-14) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (t <= 2.25e+185) 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.1e-14)
tmp = (x / (t - z)) / y;
elseif (t <= 2.25e+185)
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.1e-14], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 2.25e+185], 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.1 \cdot 10^{-14}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{+185}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 1.1e-14Initial program 88.3%
Taylor expanded in y around inf 58.7%
*-commutative58.7%
associate-/r*66.9%
Simplified66.9%
if 1.1e-14 < t < 2.2500000000000001e185Initial program 98.1%
Taylor expanded in t around inf 86.6%
if 2.2500000000000001e185 < t Initial program 81.8%
*-un-lft-identity81.8%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 99.9%
associate-*l/99.9%
*-un-lft-identity99.9%
Applied egg-rr99.9%
Final simplification74.4%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 2.35e+185) (/ x (* (- y z) (- t z))) (/ (/ x t) (- y z))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.35e+185) {
tmp = x / ((y - z) * (t - 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 <= 2.35d+185) then
tmp = x / ((y - z) * (t - 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 <= 2.35e+185) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= 2.35e+185: tmp = x / ((y - z) * (t - 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 <= 2.35e+185) tmp = Float64(x / Float64(Float64(y - z) * Float64(t - 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 <= 2.35e+185)
tmp = x / ((y - z) * (t - 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, 2.35e+185], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - 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 2.35 \cdot 10^{+185}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 2.34999999999999986e185Initial program 90.6%
if 2.34999999999999986e185 < t Initial program 81.8%
*-un-lft-identity81.8%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 99.9%
associate-*l/99.9%
*-un-lft-identity99.9%
Applied egg-rr99.9%
Final simplification91.6%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* (/ 1.0 (- y z)) (/ x (- t z))))
assert(y < t);
double code(double x, double y, double z, double t) {
return (1.0 / (y - z)) * (x / (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 = (1.0d0 / (y - z)) * (x / (t - z))
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
return (1.0 / (y - z)) * (x / (t - z));
}
[y, t] = sort([y, t]) def code(x, y, z, t): return (1.0 / (y - z)) * (x / (t - z))
y, t = sort([y, t]) function code(x, y, z, t) return Float64(Float64(1.0 / Float64(y - z)) * Float64(x / Float64(t - z))) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 / (y - z)) * (x / (t - z));
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\frac{1}{y - z} \cdot \frac{x}{t - z}
\end{array}
Initial program 89.7%
*-un-lft-identity89.7%
times-frac96.0%
Applied egg-rr96.0%
Final simplification96.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 -2e-12) (not (<= z 2.5e-45))) (/ (- x) (* z t)) (/ (/ x y) t)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2e-12) || !(z <= 2.5e-45)) {
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 <= (-2d-12)) .or. (.not. (z <= 2.5d-45))) 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 <= -2e-12) || !(z <= 2.5e-45)) {
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 <= -2e-12) or not (z <= 2.5e-45): 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 <= -2e-12) || !(z <= 2.5e-45)) tmp = Float64(Float64(-x) / Float64(z * t)); else tmp = Float64(Float64(x / 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 <= -2e-12) || ~((z <= 2.5e-45)))
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, -2e-12], N[Not[LessEqual[z, 2.5e-45]], $MachinePrecision]], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-12} \lor \neg \left(z \leq 2.5 \cdot 10^{-45}\right):\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if z < -1.99999999999999996e-12 or 2.49999999999999988e-45 < z Initial program 87.7%
Taylor expanded in y around 0 77.2%
associate-*r/77.2%
neg-mul-177.2%
Simplified77.2%
Taylor expanded in z around 0 46.2%
associate-*r/46.2%
neg-mul-146.2%
*-commutative46.2%
Simplified46.2%
if -1.99999999999999996e-12 < z < 2.49999999999999988e-45Initial program 92.4%
Taylor expanded in z around 0 56.7%
*-un-lft-identity56.7%
times-frac64.7%
Applied egg-rr64.7%
associate-*l/64.7%
*-lft-identity64.7%
Simplified64.7%
Final simplification53.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 -1.32e+57) (not (<= z 8.2e+32))) (/ x (* z t)) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.32e+57) || !(z <= 8.2e+32)) {
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 <= (-1.32d+57)) .or. (.not. (z <= 8.2d+32))) 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 <= -1.32e+57) || !(z <= 8.2e+32)) {
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 <= -1.32e+57) or not (z <= 8.2e+32): 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 <= -1.32e+57) || !(z <= 8.2e+32)) 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 <= -1.32e+57) || ~((z <= 8.2e+32)))
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, -1.32e+57], N[Not[LessEqual[z, 8.2e+32]], $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 -1.32 \cdot 10^{+57} \lor \neg \left(z \leq 8.2 \cdot 10^{+32}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.32000000000000001e57 or 8.19999999999999961e32 < z Initial program 84.7%
Taylor expanded in y around 0 81.3%
associate-*r/81.3%
neg-mul-181.3%
Simplified81.3%
expm1-log1p-u80.9%
expm1-udef72.3%
add-sqr-sqrt33.8%
sqrt-unprod64.1%
sqr-neg64.1%
sqrt-unprod36.6%
add-sqr-sqrt69.7%
Applied egg-rr69.7%
expm1-def68.4%
expm1-log1p68.4%
associate-/r*66.6%
Simplified66.6%
Taylor expanded in z around 0 43.5%
*-commutative43.5%
Simplified43.5%
if -1.32000000000000001e57 < z < 8.19999999999999961e32Initial program 93.7%
Taylor expanded in z around 0 52.3%
Final simplification48.4%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -1.9e+57) (not (<= z 2.2e+32))) (/ x (* z t)) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.9e+57) || !(z <= 2.2e+32)) {
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 ((z <= (-1.9d+57)) .or. (.not. (z <= 2.2d+32))) 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 ((z <= -1.9e+57) || !(z <= 2.2e+32)) {
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 (z <= -1.9e+57) or not (z <= 2.2e+32): 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 ((z <= -1.9e+57) || !(z <= 2.2e+32)) tmp = 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 ((z <= -1.9e+57) || ~((z <= 2.2e+32)))
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[Or[LessEqual[z, -1.9e+57], N[Not[LessEqual[z, 2.2e+32]], $MachinePrecision]], 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}\;z \leq -1.9 \cdot 10^{+57} \lor \neg \left(z \leq 2.2 \cdot 10^{+32}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -1.8999999999999999e57 or 2.20000000000000001e32 < z Initial program 84.7%
Taylor expanded in y around 0 81.3%
associate-*r/81.3%
neg-mul-181.3%
Simplified81.3%
expm1-log1p-u80.9%
expm1-udef72.3%
add-sqr-sqrt33.8%
sqrt-unprod64.1%
sqr-neg64.1%
sqrt-unprod36.6%
add-sqr-sqrt69.7%
Applied egg-rr69.7%
expm1-def68.4%
expm1-log1p68.4%
associate-/r*66.6%
Simplified66.6%
Taylor expanded in z around 0 43.5%
*-commutative43.5%
Simplified43.5%
if -1.8999999999999999e57 < z < 2.20000000000000001e32Initial program 93.7%
Taylor expanded in z around 0 52.3%
div-inv52.3%
associate-/r*52.2%
Applied egg-rr52.2%
associate-*r/56.7%
div-inv56.7%
Applied egg-rr56.7%
Final simplification50.8%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 7.5e-78) (/ x (* y (- t z))) (/ x (* (- y z) t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 7.5e-78) {
tmp = x / (y * (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 (t <= 7.5d-78) then
tmp = x / (y * (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 (t <= 7.5e-78) {
tmp = x / (y * (t - z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= 7.5e-78: tmp = x / (y * (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 (t <= 7.5e-78) tmp = Float64(x / Float64(y * 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 (t <= 7.5e-78)
tmp = x / (y * (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[t, 7.5e-78], N[(x / N[(y * N[(t - z), $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}\;t \leq 7.5 \cdot 10^{-78}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < 7.50000000000000041e-78Initial program 88.3%
Taylor expanded in y around inf 59.1%
*-commutative59.1%
Simplified59.1%
if 7.50000000000000041e-78 < t Initial program 92.3%
Taylor expanded in t around inf 78.9%
Final simplification65.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 89.7%
Taylor expanded in z around 0 36.3%
Final simplification36.3%
(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 2023314
(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))))