
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ (/ x (- t z)) (- y z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / (t - z)) / (y - z)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (x / (t - z)) / (y - z)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(t - z)) / Float64(y - z)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (t - z)) / (y - z);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{\frac{x}{t - z}}{y - z}
\end{array}
Initial program 88.5%
*-un-lft-identity88.5%
times-frac96.5%
Applied egg-rr96.5%
associate-*l/96.5%
*-un-lft-identity96.5%
Applied egg-rr96.5%
Final simplification96.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t -5.5e-84)
(/ (/ x y) t)
(if (<= t 3.6e-163)
(/ (/ (- x) z) y)
(if (<= t 0.032)
(/ x (* t y))
(if (<= t 5.8e+85)
(/ (- x) (* t z))
(if (<= t 2.85e+162) (/ 1.0 (* y (/ t x))) (/ (/ (- x) t) z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.5e-84) {
tmp = (x / y) / t;
} else if (t <= 3.6e-163) {
tmp = (-x / z) / y;
} else if (t <= 0.032) {
tmp = x / (t * y);
} else if (t <= 5.8e+85) {
tmp = -x / (t * z);
} else if (t <= 2.85e+162) {
tmp = 1.0 / (y * (t / x));
} else {
tmp = (-x / t) / z;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5.5d-84)) then
tmp = (x / y) / t
else if (t <= 3.6d-163) then
tmp = (-x / z) / y
else if (t <= 0.032d0) then
tmp = x / (t * y)
else if (t <= 5.8d+85) then
tmp = -x / (t * z)
else if (t <= 2.85d+162) then
tmp = 1.0d0 / (y * (t / x))
else
tmp = (-x / t) / z
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.5e-84) {
tmp = (x / y) / t;
} else if (t <= 3.6e-163) {
tmp = (-x / z) / y;
} else if (t <= 0.032) {
tmp = x / (t * y);
} else if (t <= 5.8e+85) {
tmp = -x / (t * z);
} else if (t <= 2.85e+162) {
tmp = 1.0 / (y * (t / x));
} else {
tmp = (-x / t) / z;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -5.5e-84: tmp = (x / y) / t elif t <= 3.6e-163: tmp = (-x / z) / y elif t <= 0.032: tmp = x / (t * y) elif t <= 5.8e+85: tmp = -x / (t * z) elif t <= 2.85e+162: tmp = 1.0 / (y * (t / x)) else: tmp = (-x / t) / z return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -5.5e-84) tmp = Float64(Float64(x / y) / t); elseif (t <= 3.6e-163) tmp = Float64(Float64(Float64(-x) / z) / y); elseif (t <= 0.032) tmp = Float64(x / Float64(t * y)); elseif (t <= 5.8e+85) tmp = Float64(Float64(-x) / Float64(t * z)); elseif (t <= 2.85e+162) tmp = Float64(1.0 / Float64(y * Float64(t / x))); else tmp = Float64(Float64(Float64(-x) / t) / z); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -5.5e-84)
tmp = (x / y) / t;
elseif (t <= 3.6e-163)
tmp = (-x / z) / y;
elseif (t <= 0.032)
tmp = x / (t * y);
elseif (t <= 5.8e+85)
tmp = -x / (t * z);
elseif (t <= 2.85e+162)
tmp = 1.0 / (y * (t / x));
else
tmp = (-x / t) / z;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -5.5e-84], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 3.6e-163], N[(N[((-x) / z), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 0.032], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e+85], N[((-x) / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.85e+162], N[(1.0 / N[(y * N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-84}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-163}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y}\\
\mathbf{elif}\;t \leq 0.032:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+85}:\\
\;\;\;\;\frac{-x}{t \cdot z}\\
\mathbf{elif}\;t \leq 2.85 \cdot 10^{+162}:\\
\;\;\;\;\frac{1}{y \cdot \frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-x}{t}}{z}\\
\end{array}
\end{array}
if t < -5.50000000000000019e-84Initial program 86.5%
Taylor expanded in z around 0 52.7%
associate-/r*57.0%
div-inv57.0%
Applied egg-rr57.0%
associate-*l/57.4%
un-div-inv57.5%
Applied egg-rr57.5%
if -5.50000000000000019e-84 < t < 3.5999999999999998e-163Initial program 90.5%
Taylor expanded in y around inf 53.0%
*-commutative53.0%
associate-/r*50.8%
Simplified50.8%
Taylor expanded in t around 0 45.3%
associate-*r/45.3%
neg-mul-145.3%
Simplified45.3%
if 3.5999999999999998e-163 < t < 0.032000000000000001Initial program 93.7%
Taylor expanded in z around 0 59.3%
if 0.032000000000000001 < t < 5.79999999999999995e85Initial program 89.9%
clear-num89.9%
associate-/r/89.9%
Applied egg-rr89.9%
Taylor expanded in y around 0 64.4%
associate-/r*64.4%
Simplified64.4%
Taylor expanded in z around 0 59.5%
mul-1-neg59.5%
Simplified59.5%
if 5.79999999999999995e85 < t < 2.84999999999999998e162Initial program 85.3%
Taylor expanded in z around 0 77.8%
associate-/r*68.8%
div-inv68.8%
Applied egg-rr68.8%
clear-num68.7%
frac-times70.7%
metadata-eval70.7%
Applied egg-rr70.7%
if 2.84999999999999998e162 < t Initial program 84.5%
clear-num83.9%
associate-/r/84.3%
Applied egg-rr84.3%
Taylor expanded in y around 0 63.6%
associate-/r*63.6%
Simplified63.6%
Taylor expanded in z around 0 63.7%
mul-1-neg63.7%
associate-/r*71.4%
distribute-neg-frac71.4%
Simplified71.4%
Final simplification56.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* t y))))
(if (<= t -1.2e-82)
(/ (/ x y) t)
(if (<= t 4.2e-163)
(/ (/ (- x) z) y)
(if (<= t 0.032)
t_1
(if (<= t 4.9e+85)
(/ (- x) (* t z))
(if (<= t 6.6e+160) t_1 (/ (/ (- x) t) z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (t * y);
double tmp;
if (t <= -1.2e-82) {
tmp = (x / y) / t;
} else if (t <= 4.2e-163) {
tmp = (-x / z) / y;
} else if (t <= 0.032) {
tmp = t_1;
} else if (t <= 4.9e+85) {
tmp = -x / (t * z);
} else if (t <= 6.6e+160) {
tmp = t_1;
} else {
tmp = (-x / t) / z;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (t * y)
if (t <= (-1.2d-82)) then
tmp = (x / y) / t
else if (t <= 4.2d-163) then
tmp = (-x / z) / y
else if (t <= 0.032d0) then
tmp = t_1
else if (t <= 4.9d+85) then
tmp = -x / (t * z)
else if (t <= 6.6d+160) then
tmp = t_1
else
tmp = (-x / t) / z
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = x / (t * y);
double tmp;
if (t <= -1.2e-82) {
tmp = (x / y) / t;
} else if (t <= 4.2e-163) {
tmp = (-x / z) / y;
} else if (t <= 0.032) {
tmp = t_1;
} else if (t <= 4.9e+85) {
tmp = -x / (t * z);
} else if (t <= 6.6e+160) {
tmp = t_1;
} else {
tmp = (-x / t) / z;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x / (t * y) tmp = 0 if t <= -1.2e-82: tmp = (x / y) / t elif t <= 4.2e-163: tmp = (-x / z) / y elif t <= 0.032: tmp = t_1 elif t <= 4.9e+85: tmp = -x / (t * z) elif t <= 6.6e+160: tmp = t_1 else: tmp = (-x / t) / z return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(t * y)) tmp = 0.0 if (t <= -1.2e-82) tmp = Float64(Float64(x / y) / t); elseif (t <= 4.2e-163) tmp = Float64(Float64(Float64(-x) / z) / y); elseif (t <= 0.032) tmp = t_1; elseif (t <= 4.9e+85) tmp = Float64(Float64(-x) / Float64(t * z)); elseif (t <= 6.6e+160) tmp = t_1; else tmp = Float64(Float64(Float64(-x) / t) / z); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = x / (t * y);
tmp = 0.0;
if (t <= -1.2e-82)
tmp = (x / y) / t;
elseif (t <= 4.2e-163)
tmp = (-x / z) / y;
elseif (t <= 0.032)
tmp = t_1;
elseif (t <= 4.9e+85)
tmp = -x / (t * z);
elseif (t <= 6.6e+160)
tmp = t_1;
else
tmp = (-x / t) / z;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.2e-82], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 4.2e-163], N[(N[((-x) / z), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 0.032], t$95$1, If[LessEqual[t, 4.9e+85], N[((-x) / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.6e+160], t$95$1, N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{t \cdot y}\\
\mathbf{if}\;t \leq -1.2 \cdot 10^{-82}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-163}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y}\\
\mathbf{elif}\;t \leq 0.032:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{+85}:\\
\;\;\;\;\frac{-x}{t \cdot z}\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+160}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-x}{t}}{z}\\
\end{array}
\end{array}
if t < -1.20000000000000004e-82Initial program 86.5%
Taylor expanded in z around 0 52.7%
associate-/r*57.0%
div-inv57.0%
Applied egg-rr57.0%
associate-*l/57.4%
un-div-inv57.5%
Applied egg-rr57.5%
if -1.20000000000000004e-82 < t < 4.19999999999999996e-163Initial program 90.5%
Taylor expanded in y around inf 53.0%
*-commutative53.0%
associate-/r*50.8%
Simplified50.8%
Taylor expanded in t around 0 45.3%
associate-*r/45.3%
neg-mul-145.3%
Simplified45.3%
if 4.19999999999999996e-163 < t < 0.032000000000000001 or 4.8999999999999997e85 < t < 6.5999999999999994e160Initial program 91.2%
Taylor expanded in z around 0 64.8%
if 0.032000000000000001 < t < 4.8999999999999997e85Initial program 89.9%
clear-num89.9%
associate-/r/89.9%
Applied egg-rr89.9%
Taylor expanded in y around 0 64.4%
associate-/r*64.4%
Simplified64.4%
Taylor expanded in z around 0 59.5%
mul-1-neg59.5%
Simplified59.5%
if 6.5999999999999994e160 < t Initial program 84.5%
clear-num83.9%
associate-/r/84.3%
Applied egg-rr84.3%
Taylor expanded in y around 0 63.6%
associate-/r*63.6%
Simplified63.6%
Taylor expanded in z around 0 63.7%
mul-1-neg63.7%
associate-/r*71.4%
distribute-neg-frac71.4%
Simplified71.4%
Final simplification57.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- x) (* z (- t z)))))
(if (<= z -2.2e-22)
t_1
(if (<= z 2.1e-154)
(/ x (* t (- y z)))
(if (<= z 3.1e+64) (/ (/ x (- t z)) y) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = -x / (z * (t - z));
double tmp;
if (z <= -2.2e-22) {
tmp = t_1;
} else if (z <= 2.1e-154) {
tmp = x / (t * (y - z));
} else if (z <= 3.1e+64) {
tmp = (x / (t - z)) / y;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = -x / (z * (t - z))
if (z <= (-2.2d-22)) then
tmp = t_1
else if (z <= 2.1d-154) then
tmp = x / (t * (y - z))
else if (z <= 3.1d+64) then
tmp = (x / (t - z)) / y
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = -x / (z * (t - z));
double tmp;
if (z <= -2.2e-22) {
tmp = t_1;
} else if (z <= 2.1e-154) {
tmp = x / (t * (y - z));
} else if (z <= 3.1e+64) {
tmp = (x / (t - z)) / y;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = -x / (z * (t - z)) tmp = 0 if z <= -2.2e-22: tmp = t_1 elif z <= 2.1e-154: tmp = x / (t * (y - z)) elif z <= 3.1e+64: tmp = (x / (t - z)) / y else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(-x) / Float64(z * Float64(t - z))) tmp = 0.0 if (z <= -2.2e-22) tmp = t_1; elseif (z <= 2.1e-154) tmp = Float64(x / Float64(t * Float64(y - z))); elseif (z <= 3.1e+64) tmp = Float64(Float64(x / Float64(t - z)) / y); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = -x / (z * (t - z));
tmp = 0.0;
if (z <= -2.2e-22)
tmp = t_1;
elseif (z <= 2.1e-154)
tmp = x / (t * (y - z));
elseif (z <= 3.1e+64)
tmp = (x / (t - z)) / y;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-x) / N[(z * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e-22], t$95$1, If[LessEqual[z, 2.1e-154], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+64], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{-x}{z \cdot \left(t - z\right)}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{-22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-154}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+64}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.2000000000000001e-22 or 3.0999999999999999e64 < z Initial program 83.7%
Taylor expanded in y around 0 76.8%
associate-*r/76.8%
neg-mul-176.8%
Simplified76.8%
if -2.2000000000000001e-22 < z < 2.09999999999999984e-154Initial program 94.6%
Taylor expanded in t around inf 75.5%
if 2.09999999999999984e-154 < z < 3.0999999999999999e64Initial program 89.3%
Taylor expanded in y around inf 60.5%
*-commutative60.5%
associate-/r*70.9%
Simplified70.9%
Final simplification75.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ (- x) z) (- t z))))
(if (<= z -1.4e-21)
t_1
(if (<= z 1.82e-152)
(/ x (* t (- y z)))
(if (<= z 3.1e+64) (/ (/ x (- t z)) y) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (-x / z) / (t - z);
double tmp;
if (z <= -1.4e-21) {
tmp = t_1;
} else if (z <= 1.82e-152) {
tmp = x / (t * (y - z));
} else if (z <= 3.1e+64) {
tmp = (x / (t - z)) / y;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (-x / z) / (t - z)
if (z <= (-1.4d-21)) then
tmp = t_1
else if (z <= 1.82d-152) then
tmp = x / (t * (y - z))
else if (z <= 3.1d+64) then
tmp = (x / (t - z)) / y
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (-x / z) / (t - z);
double tmp;
if (z <= -1.4e-21) {
tmp = t_1;
} else if (z <= 1.82e-152) {
tmp = x / (t * (y - z));
} else if (z <= 3.1e+64) {
tmp = (x / (t - z)) / y;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (-x / z) / (t - z) tmp = 0 if z <= -1.4e-21: tmp = t_1 elif z <= 1.82e-152: tmp = x / (t * (y - z)) elif z <= 3.1e+64: tmp = (x / (t - z)) / y else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(Float64(-x) / z) / Float64(t - z)) tmp = 0.0 if (z <= -1.4e-21) tmp = t_1; elseif (z <= 1.82e-152) tmp = Float64(x / Float64(t * Float64(y - z))); elseif (z <= 3.1e+64) tmp = Float64(Float64(x / Float64(t - z)) / y); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (-x / z) / (t - z);
tmp = 0.0;
if (z <= -1.4e-21)
tmp = t_1;
elseif (z <= 1.82e-152)
tmp = x / (t * (y - z));
elseif (z <= 3.1e+64)
tmp = (x / (t - z)) / y;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[((-x) / z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.4e-21], t$95$1, If[LessEqual[z, 1.82e-152], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+64], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{-x}{z}}{t - z}\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{-21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.82 \cdot 10^{-152}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+64}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.40000000000000002e-21 or 3.0999999999999999e64 < z Initial program 83.7%
*-un-lft-identity83.7%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 76.8%
mul-1-neg76.8%
associate-/r*87.5%
distribute-neg-frac87.5%
distribute-frac-neg87.5%
Simplified87.5%
if -1.40000000000000002e-21 < z < 1.82000000000000009e-152Initial program 94.6%
Taylor expanded in t around inf 75.5%
if 1.82000000000000009e-152 < z < 3.0999999999999999e64Initial program 89.3%
Taylor expanded in y around inf 60.5%
*-commutative60.5%
associate-/r*70.9%
Simplified70.9%
Final simplification80.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- x) z)))
(if (<= z -1.4e+157)
(/ t_1 (- t z))
(if (<= z 7.4e+110) (/ x (* (- t z) (- y z))) (/ t_1 (- y z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = -x / z;
double tmp;
if (z <= -1.4e+157) {
tmp = t_1 / (t - z);
} else if (z <= 7.4e+110) {
tmp = x / ((t - z) * (y - z));
} else {
tmp = t_1 / (y - z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = -x / z
if (z <= (-1.4d+157)) then
tmp = t_1 / (t - z)
else if (z <= 7.4d+110) then
tmp = x / ((t - z) * (y - z))
else
tmp = t_1 / (y - z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = -x / z;
double tmp;
if (z <= -1.4e+157) {
tmp = t_1 / (t - z);
} else if (z <= 7.4e+110) {
tmp = x / ((t - z) * (y - z));
} else {
tmp = t_1 / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = -x / z tmp = 0 if z <= -1.4e+157: tmp = t_1 / (t - z) elif z <= 7.4e+110: tmp = x / ((t - z) * (y - z)) else: tmp = t_1 / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(-x) / z) tmp = 0.0 if (z <= -1.4e+157) tmp = Float64(t_1 / Float64(t - z)); elseif (z <= 7.4e+110) tmp = Float64(x / Float64(Float64(t - z) * Float64(y - z))); else tmp = Float64(t_1 / Float64(y - z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = -x / z;
tmp = 0.0;
if (z <= -1.4e+157)
tmp = t_1 / (t - z);
elseif (z <= 7.4e+110)
tmp = x / ((t - z) * (y - z));
else
tmp = t_1 / (y - z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-x) / z), $MachinePrecision]}, If[LessEqual[z, -1.4e+157], N[(t$95$1 / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.4e+110], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{-x}{z}\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{+157}:\\
\;\;\;\;\frac{t_1}{t - z}\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{+110}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{y - z}\\
\end{array}
\end{array}
if z < -1.4000000000000001e157Initial program 77.6%
*-un-lft-identity77.6%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 77.6%
mul-1-neg77.6%
associate-/r*100.0%
distribute-neg-frac100.0%
distribute-frac-neg100.0%
Simplified100.0%
if -1.4000000000000001e157 < z < 7.40000000000000024e110Initial program 92.7%
if 7.40000000000000024e110 < z Initial program 77.2%
*-un-lft-identity77.2%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 77.0%
mul-1-neg77.0%
associate-/r*92.1%
distribute-neg-frac92.1%
distribute-frac-neg92.1%
Simplified92.1%
Final simplification93.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -4.9e-105) (/ (/ x (- t z)) y) (if (<= t 1.4e-113) (/ (- x) (* z (- y z))) (/ x (* t (- y z))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.9e-105) {
tmp = (x / (t - z)) / y;
} else if (t <= 1.4e-113) {
tmp = -x / (z * (y - z));
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-4.9d-105)) then
tmp = (x / (t - z)) / y
else if (t <= 1.4d-113) then
tmp = -x / (z * (y - z))
else
tmp = x / (t * (y - z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.9e-105) {
tmp = (x / (t - z)) / y;
} else if (t <= 1.4e-113) {
tmp = -x / (z * (y - z));
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -4.9e-105: tmp = (x / (t - z)) / y elif t <= 1.4e-113: tmp = -x / (z * (y - z)) else: tmp = x / (t * (y - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -4.9e-105) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (t <= 1.4e-113) tmp = Float64(Float64(-x) / Float64(z * Float64(y - z))); else tmp = Float64(x / Float64(t * Float64(y - z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -4.9e-105)
tmp = (x / (t - z)) / y;
elseif (t <= 1.4e-113)
tmp = -x / (z * (y - z));
else
tmp = x / (t * (y - z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -4.9e-105], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 1.4e-113], N[((-x) / N[(z * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.9 \cdot 10^{-105}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-113}:\\
\;\;\;\;\frac{-x}{z \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if t < -4.9e-105Initial program 86.3%
Taylor expanded in y around inf 56.1%
*-commutative56.1%
associate-/r*59.0%
Simplified59.0%
if -4.9e-105 < t < 1.4e-113Initial program 91.2%
Taylor expanded in t around 0 78.6%
associate-*r/78.6%
neg-mul-178.6%
Simplified78.6%
if 1.4e-113 < t Initial program 88.0%
Taylor expanded in t around inf 80.5%
Final simplification73.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -2.8e-108) (/ (/ x (- t z)) y) (if (<= t 1.5e-113) (/ (/ (- x) z) (- y z)) (/ x (* t (- y z))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.8e-108) {
tmp = (x / (t - z)) / y;
} else if (t <= 1.5e-113) {
tmp = (-x / z) / (y - z);
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2.8d-108)) then
tmp = (x / (t - z)) / y
else if (t <= 1.5d-113) then
tmp = (-x / z) / (y - z)
else
tmp = x / (t * (y - z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.8e-108) {
tmp = (x / (t - z)) / y;
} else if (t <= 1.5e-113) {
tmp = (-x / z) / (y - z);
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -2.8e-108: tmp = (x / (t - z)) / y elif t <= 1.5e-113: tmp = (-x / z) / (y - z) else: tmp = x / (t * (y - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -2.8e-108) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (t <= 1.5e-113) tmp = Float64(Float64(Float64(-x) / z) / Float64(y - z)); else tmp = Float64(x / Float64(t * Float64(y - z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -2.8e-108)
tmp = (x / (t - z)) / y;
elseif (t <= 1.5e-113)
tmp = (-x / z) / (y - z);
else
tmp = x / (t * (y - z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -2.8e-108], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 1.5e-113], N[(N[((-x) / z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-108}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-113}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if t < -2.8e-108Initial program 86.3%
Taylor expanded in y around inf 56.1%
*-commutative56.1%
associate-/r*59.0%
Simplified59.0%
if -2.8e-108 < t < 1.5e-113Initial program 91.2%
*-un-lft-identity91.2%
times-frac93.0%
Applied egg-rr93.0%
Taylor expanded in t around 0 78.6%
mul-1-neg78.6%
associate-/r*82.7%
distribute-neg-frac82.7%
distribute-frac-neg82.7%
Simplified82.7%
if 1.5e-113 < t Initial program 88.0%
Taylor expanded in t around inf 80.5%
Final simplification74.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -8.5e-85) (/ (/ x y) t) (if (<= t 9e-168) (/ (/ (- x) z) y) (/ x (* t (- y z))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.5e-85) {
tmp = (x / y) / t;
} else if (t <= 9e-168) {
tmp = (-x / z) / y;
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-8.5d-85)) then
tmp = (x / y) / t
else if (t <= 9d-168) then
tmp = (-x / z) / y
else
tmp = x / (t * (y - z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.5e-85) {
tmp = (x / y) / t;
} else if (t <= 9e-168) {
tmp = (-x / z) / y;
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -8.5e-85: tmp = (x / y) / t elif t <= 9e-168: tmp = (-x / z) / y else: tmp = x / (t * (y - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -8.5e-85) tmp = Float64(Float64(x / y) / t); elseif (t <= 9e-168) tmp = Float64(Float64(Float64(-x) / z) / y); else tmp = Float64(x / Float64(t * Float64(y - z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -8.5e-85)
tmp = (x / y) / t;
elseif (t <= 9e-168)
tmp = (-x / z) / y;
else
tmp = x / (t * (y - z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -8.5e-85], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 9e-168], N[(N[((-x) / z), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-85}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-168}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if t < -8.50000000000000052e-85Initial program 86.5%
Taylor expanded in z around 0 52.7%
associate-/r*57.0%
div-inv57.0%
Applied egg-rr57.0%
associate-*l/57.4%
un-div-inv57.5%
Applied egg-rr57.5%
if -8.50000000000000052e-85 < t < 9.0000000000000002e-168Initial program 90.3%
Taylor expanded in y around inf 54.3%
*-commutative54.3%
associate-/r*52.0%
Simplified52.0%
Taylor expanded in t around 0 46.4%
associate-*r/46.4%
neg-mul-146.4%
Simplified46.4%
if 9.0000000000000002e-168 < t Initial program 88.7%
Taylor expanded in t around inf 75.6%
Final simplification61.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= y -5.2e-132) (not (<= y 1.15e-82))) (/ (/ x y) t) (/ (- x) (* t z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.2e-132) || !(y <= 1.15e-82)) {
tmp = (x / y) / t;
} else {
tmp = -x / (t * z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-5.2d-132)) .or. (.not. (y <= 1.15d-82))) then
tmp = (x / y) / t
else
tmp = -x / (t * z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.2e-132) || !(y <= 1.15e-82)) {
tmp = (x / y) / t;
} else {
tmp = -x / (t * z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -5.2e-132) or not (y <= 1.15e-82): tmp = (x / y) / t else: tmp = -x / (t * z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -5.2e-132) || !(y <= 1.15e-82)) tmp = Float64(Float64(x / y) / t); else tmp = Float64(Float64(-x) / Float64(t * z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((y <= -5.2e-132) || ~((y <= 1.15e-82)))
tmp = (x / y) / t;
else
tmp = -x / (t * z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.2e-132], N[Not[LessEqual[y, 1.15e-82]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], N[((-x) / N[(t * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{-132} \lor \neg \left(y \leq 1.15 \cdot 10^{-82}\right):\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{t \cdot z}\\
\end{array}
\end{array}
if y < -5.2000000000000002e-132 or 1.14999999999999998e-82 < y Initial program 89.5%
Taylor expanded in z around 0 52.0%
associate-/r*53.7%
div-inv53.6%
Applied egg-rr53.6%
associate-*l/57.3%
un-div-inv57.4%
Applied egg-rr57.4%
if -5.2000000000000002e-132 < y < 1.14999999999999998e-82Initial program 86.5%
clear-num85.8%
associate-/r/86.3%
Applied egg-rr86.3%
Taylor expanded in y around 0 76.0%
associate-/r*76.0%
Simplified76.0%
Taylor expanded in z around 0 44.2%
mul-1-neg44.2%
Simplified44.2%
Final simplification53.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= y -2.45e-132) (not (<= y 7.8e-61))) (/ (/ x y) t) (/ (/ (- x) t) z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.45e-132) || !(y <= 7.8e-61)) {
tmp = (x / y) / t;
} else {
tmp = (-x / t) / z;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-2.45d-132)) .or. (.not. (y <= 7.8d-61))) then
tmp = (x / y) / t
else
tmp = (-x / t) / z
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.45e-132) || !(y <= 7.8e-61)) {
tmp = (x / y) / t;
} else {
tmp = (-x / t) / z;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -2.45e-132) or not (y <= 7.8e-61): tmp = (x / y) / t else: tmp = (-x / t) / z return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -2.45e-132) || !(y <= 7.8e-61)) tmp = Float64(Float64(x / y) / t); else tmp = Float64(Float64(Float64(-x) / t) / z); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((y <= -2.45e-132) || ~((y <= 7.8e-61)))
tmp = (x / y) / t;
else
tmp = (-x / t) / z;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.45e-132], N[Not[LessEqual[y, 7.8e-61]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.45 \cdot 10^{-132} \lor \neg \left(y \leq 7.8 \cdot 10^{-61}\right):\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-x}{t}}{z}\\
\end{array}
\end{array}
if y < -2.4499999999999999e-132 or 7.80000000000000065e-61 < y Initial program 89.2%
Taylor expanded in z around 0 53.4%
associate-/r*55.1%
div-inv55.1%
Applied egg-rr55.1%
associate-*l/58.8%
un-div-inv58.9%
Applied egg-rr58.9%
if -2.4499999999999999e-132 < y < 7.80000000000000065e-61Initial program 87.2%
clear-num86.5%
associate-/r/87.0%
Applied egg-rr87.0%
Taylor expanded in y around 0 74.1%
associate-/r*74.1%
Simplified74.1%
Taylor expanded in z around 0 43.6%
mul-1-neg43.6%
associate-/r*44.3%
distribute-neg-frac44.3%
Simplified44.3%
Final simplification53.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -9.5e+43) (not (<= z 2.9e+49))) (/ x (* z y)) (/ x (* t y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.5e+43) || !(z <= 2.9e+49)) {
tmp = x / (z * y);
} else {
tmp = x / (t * y);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-9.5d+43)) .or. (.not. (z <= 2.9d+49))) then
tmp = x / (z * y)
else
tmp = x / (t * y)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.5e+43) || !(z <= 2.9e+49)) {
tmp = x / (z * y);
} else {
tmp = x / (t * y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -9.5e+43) or not (z <= 2.9e+49): tmp = x / (z * y) else: tmp = x / (t * y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -9.5e+43) || !(z <= 2.9e+49)) tmp = Float64(x / Float64(z * y)); else tmp = Float64(x / Float64(t * y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -9.5e+43) || ~((z <= 2.9e+49)))
tmp = x / (z * y);
else
tmp = x / (t * y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9.5e+43], N[Not[LessEqual[z, 2.9e+49]], $MachinePrecision]], N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+43} \lor \neg \left(z \leq 2.9 \cdot 10^{+49}\right):\\
\;\;\;\;\frac{x}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -9.5000000000000004e43 or 2.9e49 < z Initial program 83.4%
Taylor expanded in t around 0 76.8%
associate-*r/76.8%
neg-mul-176.8%
Simplified76.8%
Taylor expanded in z around 0 35.7%
mul-1-neg35.7%
associate-/r*34.1%
distribute-neg-frac34.1%
distribute-frac-neg34.1%
Simplified34.1%
expm1-log1p-u33.7%
expm1-udef54.3%
associate-/l/54.3%
add-sqr-sqrt26.2%
sqrt-unprod51.4%
sqr-neg51.4%
sqrt-unprod28.0%
add-sqr-sqrt54.3%
*-commutative54.3%
Applied egg-rr54.3%
expm1-def34.2%
expm1-log1p34.5%
*-commutative34.5%
Simplified34.5%
if -9.5000000000000004e43 < z < 2.9e49Initial program 92.9%
Taylor expanded in z around 0 56.1%
Final simplification46.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -2.3e+212) (not (<= z 1.35e+111))) (/ x (* z y)) (/ (/ x t) y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.3e+212) || !(z <= 1.35e+111)) {
tmp = x / (z * y);
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.3d+212)) .or. (.not. (z <= 1.35d+111))) then
tmp = x / (z * y)
else
tmp = (x / t) / y
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.3e+212) || !(z <= 1.35e+111)) {
tmp = x / (z * y);
} else {
tmp = (x / t) / y;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -2.3e+212) or not (z <= 1.35e+111): tmp = x / (z * y) else: tmp = (x / t) / y return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -2.3e+212) || !(z <= 1.35e+111)) tmp = Float64(x / Float64(z * y)); else tmp = Float64(Float64(x / t) / y); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -2.3e+212) || ~((z <= 1.35e+111)))
tmp = x / (z * y);
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.3e+212], N[Not[LessEqual[z, 1.35e+111]], $MachinePrecision]], N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+212} \lor \neg \left(z \leq 1.35 \cdot 10^{+111}\right):\\
\;\;\;\;\frac{x}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -2.2999999999999998e212 or 1.3499999999999999e111 < z Initial program 81.5%
Taylor expanded in t around 0 81.4%
associate-*r/81.4%
neg-mul-181.4%
Simplified81.4%
Taylor expanded in z around 0 45.9%
mul-1-neg45.9%
associate-/r*40.6%
distribute-neg-frac40.6%
distribute-frac-neg40.6%
Simplified40.6%
expm1-log1p-u40.2%
expm1-udef64.3%
associate-/l/64.4%
add-sqr-sqrt27.4%
sqrt-unprod60.5%
sqr-neg60.5%
sqrt-unprod36.9%
add-sqr-sqrt64.3%
*-commutative64.3%
Applied egg-rr64.3%
expm1-def45.4%
expm1-log1p45.8%
*-commutative45.8%
Simplified45.8%
if -2.2999999999999998e212 < z < 1.3499999999999999e111Initial program 90.4%
Taylor expanded in y around inf 61.1%
*-commutative61.1%
associate-/r*65.7%
Simplified65.7%
Taylor expanded in t around inf 49.9%
Final simplification49.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 1.5e-113) (/ x (* (- t z) y)) (/ x (* t (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.5e-113) {
tmp = x / ((t - z) * y);
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 1.5d-113) then
tmp = x / ((t - z) * y)
else
tmp = x / (t * (y - z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.5e-113) {
tmp = x / ((t - z) * y);
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 1.5e-113: tmp = x / ((t - z) * y) else: tmp = x / (t * (y - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 1.5e-113) tmp = Float64(x / Float64(Float64(t - z) * y)); else tmp = Float64(x / Float64(t * Float64(y - z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 1.5e-113)
tmp = x / ((t - z) * y);
else
tmp = x / (t * (y - z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 1.5e-113], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.5 \cdot 10^{-113}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if t < 1.5e-113Initial program 88.8%
Taylor expanded in y around inf 55.8%
*-commutative55.8%
Simplified55.8%
if 1.5e-113 < t Initial program 88.0%
Taylor expanded in t around inf 80.5%
Final simplification64.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 1.4e-113) (/ (/ x (- t z)) y) (/ x (* t (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.4e-113) {
tmp = (x / (t - z)) / y;
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 1.4d-113) then
tmp = (x / (t - z)) / y
else
tmp = x / (t * (y - z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.4e-113) {
tmp = (x / (t - z)) / y;
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 1.4e-113: tmp = (x / (t - z)) / y else: tmp = x / (t * (y - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 1.4e-113) tmp = Float64(Float64(x / Float64(t - z)) / y); else tmp = Float64(x / Float64(t * Float64(y - z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 1.4e-113)
tmp = (x / (t - z)) / y;
else
tmp = x / (t * (y - z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 1.4e-113], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.4 \cdot 10^{-113}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if t < 1.4e-113Initial program 88.8%
Taylor expanded in y around inf 55.8%
*-commutative55.8%
associate-/r*56.8%
Simplified56.8%
if 1.4e-113 < t Initial program 88.0%
Taylor expanded in t around inf 80.5%
Final simplification64.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* t y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return x / (t * y);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / (t * y)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return x / (t * y);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x / (t * y)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x / Float64(t * y)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = x / (t * y);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{t \cdot y}
\end{array}
Initial program 88.5%
Taylor expanded in z around 0 40.5%
Final simplification40.5%
(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 2024021
(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))))