
(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 14 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 91.7%
associate-/l/96.8%
Simplified96.8%
Final simplification96.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) (- z t))))
(if (<= z -1.25e-9)
t_1
(if (<= z 1.05e-91)
(/ (/ x t) (- y z))
(if (<= z 1.5e+67) (/ (/ x y) (- t z)) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / (z - t);
double tmp;
if (z <= -1.25e-9) {
tmp = t_1;
} else if (z <= 1.05e-91) {
tmp = (x / t) / (y - z);
} else if (z <= 1.5e+67) {
tmp = (x / y) / (t - z);
} 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) / (z - t)
if (z <= (-1.25d-9)) then
tmp = t_1
else if (z <= 1.05d-91) then
tmp = (x / t) / (y - z)
else if (z <= 1.5d+67) then
tmp = (x / y) / (t - z)
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) / (z - t);
double tmp;
if (z <= -1.25e-9) {
tmp = t_1;
} else if (z <= 1.05e-91) {
tmp = (x / t) / (y - z);
} else if (z <= 1.5e+67) {
tmp = (x / y) / (t - z);
} 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) / (z - t) tmp = 0 if z <= -1.25e-9: tmp = t_1 elif z <= 1.05e-91: tmp = (x / t) / (y - z) elif z <= 1.5e+67: tmp = (x / y) / (t - z) 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 / z) / Float64(z - t)) tmp = 0.0 if (z <= -1.25e-9) tmp = t_1; elseif (z <= 1.05e-91) tmp = Float64(Float64(x / t) / Float64(y - z)); elseif (z <= 1.5e+67) tmp = Float64(Float64(x / y) / Float64(t - z)); 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) / (z - t);
tmp = 0.0;
if (z <= -1.25e-9)
tmp = t_1;
elseif (z <= 1.05e-91)
tmp = (x / t) / (y - z);
elseif (z <= 1.5e+67)
tmp = (x / y) / (t - z);
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[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e-9], t$95$1, If[LessEqual[z, 1.05e-91], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+67], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $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}}{z - t}\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-91}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+67}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.25e-9 or 1.50000000000000005e67 < z Initial program 89.2%
Taylor expanded in y around 0 85.1%
associate-*r/85.1%
neg-mul-185.1%
Simplified85.1%
frac-2neg85.1%
div-inv85.1%
remove-double-neg85.1%
distribute-rgt-neg-in85.1%
Applied egg-rr85.1%
associate-/r*85.1%
Simplified85.1%
Taylor expanded in x around 0 85.1%
associate-/r*92.0%
Simplified92.0%
if -1.25e-9 < z < 1.05e-91Initial program 93.6%
associate-/l/94.4%
Simplified94.4%
Taylor expanded in t around inf 78.2%
if 1.05e-91 < z < 1.50000000000000005e67Initial program 94.3%
Taylor expanded in x around 0 94.3%
associate-/l/99.5%
Simplified99.5%
Taylor expanded in y around inf 55.1%
Final simplification81.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 (<= z -1.05e-9) (not (<= z 1.15e+22))) (/ x (* z (- z t))) (/ x (* t (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05e-9) || !(z <= 1.15e+22)) {
tmp = x / (z * (z - t));
} 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 ((z <= (-1.05d-9)) .or. (.not. (z <= 1.15d+22))) then
tmp = x / (z * (z - t))
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 ((z <= -1.05e-9) || !(z <= 1.15e+22)) {
tmp = x / (z * (z - t));
} 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 (z <= -1.05e-9) or not (z <= 1.15e+22): tmp = x / (z * (z - t)) 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 ((z <= -1.05e-9) || !(z <= 1.15e+22)) tmp = Float64(x / Float64(z * Float64(z - t))); 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 ((z <= -1.05e-9) || ~((z <= 1.15e+22)))
tmp = x / (z * (z - t));
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[Or[LessEqual[z, -1.05e-9], N[Not[LessEqual[z, 1.15e+22]], $MachinePrecision]], N[(x / N[(z * N[(z - t), $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}\;z \leq -1.05 \cdot 10^{-9} \lor \neg \left(z \leq 1.15 \cdot 10^{+22}\right):\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if z < -1.0500000000000001e-9 or 1.1500000000000001e22 < z Initial program 89.2%
Taylor expanded in y around 0 83.7%
associate-*r/83.7%
neg-mul-183.7%
Simplified83.7%
frac-2neg83.7%
div-inv83.8%
remove-double-neg83.8%
distribute-rgt-neg-in83.8%
Applied egg-rr83.8%
associate-/r*83.8%
Simplified83.8%
Taylor expanded in x around 0 83.7%
if -1.0500000000000001e-9 < z < 1.1500000000000001e22Initial program 94.0%
Taylor expanded in t around inf 74.9%
Final simplification79.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -3500.0) (/ x (* (- t z) y)) (if (<= y 1.3e-163) (/ x (* z (- z t))) (/ x (* t (- y z))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3500.0) {
tmp = x / ((t - z) * y);
} else if (y <= 1.3e-163) {
tmp = x / (z * (z - t));
} 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 (y <= (-3500.0d0)) then
tmp = x / ((t - z) * y)
else if (y <= 1.3d-163) then
tmp = x / (z * (z - t))
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 (y <= -3500.0) {
tmp = x / ((t - z) * y);
} else if (y <= 1.3e-163) {
tmp = x / (z * (z - t));
} 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 y <= -3500.0: tmp = x / ((t - z) * y) elif y <= 1.3e-163: tmp = x / (z * (z - t)) 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 (y <= -3500.0) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (y <= 1.3e-163) tmp = Float64(x / Float64(z * Float64(z - t))); 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 (y <= -3500.0)
tmp = x / ((t - z) * y);
elseif (y <= 1.3e-163)
tmp = x / (z * (z - t));
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[y, -3500.0], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e-163], N[(x / N[(z * N[(z - t), $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}\;y \leq -3500:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-163}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -3500Initial program 87.4%
Taylor expanded in y around inf 81.0%
*-commutative81.0%
Simplified81.0%
if -3500 < y < 1.30000000000000001e-163Initial program 94.8%
Taylor expanded in y around 0 75.0%
associate-*r/75.0%
neg-mul-175.0%
Simplified75.0%
frac-2neg75.0%
div-inv74.9%
remove-double-neg74.9%
distribute-rgt-neg-in74.9%
Applied egg-rr74.9%
associate-/r*74.9%
Simplified74.9%
Taylor expanded in x around 0 75.0%
if 1.30000000000000001e-163 < y Initial program 91.3%
Taylor expanded in t around inf 54.1%
Final simplification67.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -3900.0) (/ x (* (- t z) y)) (if (<= y 9.6e-164) (/ x (* z (- z t))) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3900.0) {
tmp = x / ((t - z) * y);
} else if (y <= 9.6e-164) {
tmp = x / (z * (z - t));
} 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 (y <= (-3900.0d0)) then
tmp = x / ((t - z) * y)
else if (y <= 9.6d-164) then
tmp = x / (z * (z - t))
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 (y <= -3900.0) {
tmp = x / ((t - z) * y);
} else if (y <= 9.6e-164) {
tmp = x / (z * (z - t));
} 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 y <= -3900.0: tmp = x / ((t - z) * y) elif y <= 9.6e-164: tmp = x / (z * (z - t)) 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 (y <= -3900.0) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (y <= 9.6e-164) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x / 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 (y <= -3900.0)
tmp = x / ((t - z) * y);
elseif (y <= 9.6e-164)
tmp = x / (z * (z - t));
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[y, -3900.0], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.6e-164], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3900:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{-164}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -3900Initial program 87.4%
Taylor expanded in y around inf 81.0%
*-commutative81.0%
Simplified81.0%
if -3900 < y < 9.59999999999999932e-164Initial program 94.8%
Taylor expanded in y around 0 75.0%
associate-*r/75.0%
neg-mul-175.0%
Simplified75.0%
frac-2neg75.0%
div-inv74.9%
remove-double-neg74.9%
distribute-rgt-neg-in74.9%
Applied egg-rr74.9%
associate-/r*74.9%
Simplified74.9%
Taylor expanded in x around 0 75.0%
if 9.59999999999999932e-164 < y Initial program 91.3%
associate-/l/96.1%
Simplified96.1%
Taylor expanded in t around inf 54.9%
Final simplification68.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 (<= y -3500.0) (/ (/ x y) (- t z)) (if (<= y 1.45e-162) (/ x (* z (- z t))) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3500.0) {
tmp = (x / y) / (t - z);
} else if (y <= 1.45e-162) {
tmp = x / (z * (z - t));
} 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 (y <= (-3500.0d0)) then
tmp = (x / y) / (t - z)
else if (y <= 1.45d-162) then
tmp = x / (z * (z - t))
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 (y <= -3500.0) {
tmp = (x / y) / (t - z);
} else if (y <= 1.45e-162) {
tmp = x / (z * (z - t));
} 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 y <= -3500.0: tmp = (x / y) / (t - z) elif y <= 1.45e-162: tmp = x / (z * (z - t)) 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 (y <= -3500.0) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 1.45e-162) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x / 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 (y <= -3500.0)
tmp = (x / y) / (t - z);
elseif (y <= 1.45e-162)
tmp = x / (z * (z - t));
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[y, -3500.0], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e-162], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3500:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-162}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -3500Initial program 87.4%
Taylor expanded in x around 0 87.4%
associate-/l/93.5%
Simplified93.5%
Taylor expanded in y around inf 87.2%
if -3500 < y < 1.4500000000000001e-162Initial program 94.8%
Taylor expanded in y around 0 75.3%
associate-*r/75.3%
neg-mul-175.3%
Simplified75.3%
frac-2neg75.3%
div-inv75.2%
remove-double-neg75.2%
distribute-rgt-neg-in75.2%
Applied egg-rr75.2%
associate-/r*75.2%
Simplified75.2%
Taylor expanded in x around 0 75.3%
if 1.4500000000000001e-162 < y Initial program 91.2%
associate-/l/96.1%
Simplified96.1%
Taylor expanded in t around inf 55.4%
Final simplification70.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 (<= z -9e-10) (/ (/ x z) (- z t)) (if (<= z 3.6e-45) (/ (/ x t) (- y z)) (/ (/ x z) (- z y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9e-10) {
tmp = (x / z) / (z - t);
} else if (z <= 3.6e-45) {
tmp = (x / t) / (y - z);
} else {
tmp = (x / z) / (z - 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 <= (-9d-10)) then
tmp = (x / z) / (z - t)
else if (z <= 3.6d-45) then
tmp = (x / t) / (y - z)
else
tmp = (x / z) / (z - 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 <= -9e-10) {
tmp = (x / z) / (z - t);
} else if (z <= 3.6e-45) {
tmp = (x / t) / (y - z);
} else {
tmp = (x / z) / (z - y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -9e-10: tmp = (x / z) / (z - t) elif z <= 3.6e-45: tmp = (x / t) / (y - z) else: tmp = (x / z) / (z - y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -9e-10) tmp = Float64(Float64(x / z) / Float64(z - t)); elseif (z <= 3.6e-45) tmp = Float64(Float64(x / t) / Float64(y - z)); else tmp = Float64(Float64(x / z) / Float64(z - 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 <= -9e-10)
tmp = (x / z) / (z - t);
elseif (z <= 3.6e-45)
tmp = (x / t) / (y - z);
else
tmp = (x / z) / (z - y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -9e-10], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e-45], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-10}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-45}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\end{array}
\end{array}
if z < -8.9999999999999999e-10Initial program 88.0%
Taylor expanded in y around 0 83.9%
associate-*r/83.9%
neg-mul-183.9%
Simplified83.9%
frac-2neg83.9%
div-inv83.9%
remove-double-neg83.9%
distribute-rgt-neg-in83.9%
Applied egg-rr83.9%
associate-/r*83.9%
Simplified83.9%
Taylor expanded in x around 0 83.9%
associate-/r*91.9%
Simplified91.9%
if -8.9999999999999999e-10 < z < 3.60000000000000001e-45Initial program 94.1%
associate-/l/94.1%
Simplified94.1%
Taylor expanded in t around inf 77.6%
if 3.60000000000000001e-45 < z Initial program 91.3%
associate-/l/98.4%
Simplified98.4%
Taylor expanded in t around 0 75.5%
associate-*r/75.5%
neg-mul-175.5%
Simplified75.5%
Final simplification81.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 (<= y -1.35e-123) (/ (/ x y) t) (if (<= y 2.5e-88) (/ x (* t (- z))) (/ (/ x t) y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.35e-123) {
tmp = (x / y) / t;
} else if (y <= 2.5e-88) {
tmp = x / (t * -z);
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.35d-123)) then
tmp = (x / y) / t
else if (y <= 2.5d-88) then
tmp = x / (t * -z)
else
tmp = (x / t) / y
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.35e-123) {
tmp = (x / y) / t;
} else if (y <= 2.5e-88) {
tmp = x / (t * -z);
} else {
tmp = (x / t) / y;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -1.35e-123: tmp = (x / y) / t elif y <= 2.5e-88: tmp = x / (t * -z) else: tmp = (x / t) / y return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.35e-123) tmp = Float64(Float64(x / y) / t); elseif (y <= 2.5e-88) tmp = Float64(x / Float64(t * Float64(-z))); else tmp = Float64(Float64(x / t) / y); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -1.35e-123)
tmp = (x / y) / t;
elseif (y <= 2.5e-88)
tmp = x / (t * -z);
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -1.35e-123], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 2.5e-88], N[(x / N[(t * (-z)), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{-123}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-88}:\\
\;\;\;\;\frac{x}{t \cdot \left(-z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if y < -1.35e-123Initial program 91.0%
Taylor expanded in z around 0 48.8%
*-un-lft-identity48.8%
times-frac52.9%
Applied egg-rr52.9%
associate-*l/52.9%
*-lft-identity52.9%
Simplified52.9%
if -1.35e-123 < y < 2.50000000000000004e-88Initial program 91.7%
associate-/l/97.2%
Simplified97.2%
Taylor expanded in t around inf 55.0%
Taylor expanded in y around 0 41.4%
associate-*r/41.4%
neg-mul-141.4%
Simplified41.4%
if 2.50000000000000004e-88 < y Initial program 92.4%
Taylor expanded in z around 0 44.7%
associate-/r*43.6%
div-inv43.6%
Applied egg-rr43.6%
un-div-inv43.6%
Applied egg-rr43.6%
Final simplification46.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 (or (<= z -1.92e-7) (not (<= z 8.8e+61))) (/ x (* t z)) (/ x (* t y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.92e-7) || !(z <= 8.8e+61)) {
tmp = x / (t * z);
} 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 <= (-1.92d-7)) .or. (.not. (z <= 8.8d+61))) then
tmp = x / (t * z)
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 <= -1.92e-7) || !(z <= 8.8e+61)) {
tmp = x / (t * z);
} 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 <= -1.92e-7) or not (z <= 8.8e+61): tmp = x / (t * z) 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 <= -1.92e-7) || !(z <= 8.8e+61)) tmp = Float64(x / Float64(t * z)); 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 <= -1.92e-7) || ~((z <= 8.8e+61)))
tmp = x / (t * z);
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, -1.92e-7], N[Not[LessEqual[z, 8.8e+61]], $MachinePrecision]], N[(x / N[(t * z), $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 -1.92 \cdot 10^{-7} \lor \neg \left(z \leq 8.8 \cdot 10^{+61}\right):\\
\;\;\;\;\frac{x}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -1.91999999999999999e-7 or 8.8000000000000001e61 < z Initial program 88.6%
Taylor expanded in y around 0 83.6%
associate-*r/83.6%
neg-mul-183.6%
Simplified83.6%
div-inv83.6%
add-sqr-sqrt45.3%
sqrt-unprod62.1%
sqr-neg62.1%
sqrt-unprod25.5%
add-sqr-sqrt58.7%
*-commutative58.7%
associate-/r*58.7%
Applied egg-rr58.7%
associate-*r/58.3%
associate-*l/58.3%
associate-*r/58.3%
*-rgt-identity58.3%
Simplified58.3%
Taylor expanded in z around 0 30.8%
*-commutative30.8%
Simplified30.8%
if -1.91999999999999999e-7 < z < 8.8000000000000001e61Initial program 94.3%
Taylor expanded in z around 0 57.6%
Final simplification45.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 (or (<= z -1.92e-7) (not (<= z 1.8e+67))) (/ x (* t z)) (/ (/ x t) y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.92e-7) || !(z <= 1.8e+67)) {
tmp = x / (t * z);
} 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 <= (-1.92d-7)) .or. (.not. (z <= 1.8d+67))) then
tmp = x / (t * z)
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 <= -1.92e-7) || !(z <= 1.8e+67)) {
tmp = x / (t * z);
} 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 <= -1.92e-7) or not (z <= 1.8e+67): tmp = x / (t * z) 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 <= -1.92e-7) || !(z <= 1.8e+67)) tmp = Float64(x / Float64(t * z)); 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 <= -1.92e-7) || ~((z <= 1.8e+67)))
tmp = x / (t * z);
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, -1.92e-7], N[Not[LessEqual[z, 1.8e+67]], $MachinePrecision]], N[(x / N[(t * z), $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 -1.92 \cdot 10^{-7} \lor \neg \left(z \leq 1.8 \cdot 10^{+67}\right):\\
\;\;\;\;\frac{x}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -1.91999999999999999e-7 or 1.7999999999999999e67 < z Initial program 89.0%
Taylor expanded in y around 0 84.8%
associate-*r/84.8%
neg-mul-184.8%
Simplified84.8%
div-inv84.8%
add-sqr-sqrt46.9%
sqrt-unprod64.2%
sqr-neg64.2%
sqrt-unprod26.3%
add-sqr-sqrt60.7%
*-commutative60.7%
associate-/r*60.6%
Applied egg-rr60.6%
associate-*r/60.2%
associate-*l/60.2%
associate-*r/60.2%
*-rgt-identity60.2%
Simplified60.2%
Taylor expanded in z around 0 31.8%
*-commutative31.8%
Simplified31.8%
if -1.91999999999999999e-7 < z < 1.7999999999999999e67Initial program 93.8%
Taylor expanded in z around 0 56.1%
associate-/r*60.1%
div-inv60.1%
Applied egg-rr60.1%
un-div-inv60.1%
Applied egg-rr60.1%
Final simplification47.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 (or (<= z -1.85e-7) (not (<= z 9.5e+67))) (/ x (* t z)) (/ (/ x y) t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.85e-7) || !(z <= 9.5e+67)) {
tmp = x / (t * z);
} else {
tmp = (x / y) / t;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.85d-7)) .or. (.not. (z <= 9.5d+67))) then
tmp = x / (t * z)
else
tmp = (x / y) / t
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.85e-7) || !(z <= 9.5e+67)) {
tmp = x / (t * z);
} else {
tmp = (x / y) / t;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.85e-7) or not (z <= 9.5e+67): tmp = x / (t * z) else: tmp = (x / y) / t return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -1.85e-7) || !(z <= 9.5e+67)) tmp = Float64(x / Float64(t * z)); else tmp = Float64(Float64(x / y) / t); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -1.85e-7) || ~((z <= 9.5e+67)))
tmp = x / (t * z);
else
tmp = (x / y) / t;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.85e-7], N[Not[LessEqual[z, 9.5e+67]], $MachinePrecision]], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-7} \lor \neg \left(z \leq 9.5 \cdot 10^{+67}\right):\\
\;\;\;\;\frac{x}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if z < -1.85000000000000002e-7 or 9.5000000000000002e67 < z Initial program 89.0%
Taylor expanded in y around 0 84.8%
associate-*r/84.8%
neg-mul-184.8%
Simplified84.8%
div-inv84.8%
add-sqr-sqrt46.9%
sqrt-unprod64.2%
sqr-neg64.2%
sqrt-unprod26.3%
add-sqr-sqrt60.7%
*-commutative60.7%
associate-/r*60.6%
Applied egg-rr60.6%
associate-*r/60.2%
associate-*l/60.2%
associate-*r/60.2%
*-rgt-identity60.2%
Simplified60.2%
Taylor expanded in z around 0 31.8%
*-commutative31.8%
Simplified31.8%
if -1.85000000000000002e-7 < z < 9.5000000000000002e67Initial program 93.8%
Taylor expanded in z around 0 56.1%
*-un-lft-identity56.1%
times-frac58.8%
Applied egg-rr58.8%
associate-*l/58.8%
*-lft-identity58.8%
Simplified58.8%
Final simplification46.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -2.6e+185) (/ (/ x y) (- t z)) (/ x (* (- t z) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e+185) {
tmp = (x / y) / (t - z);
} else {
tmp = x / ((t - z) * (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 (y <= (-2.6d+185)) then
tmp = (x / y) / (t - z)
else
tmp = x / ((t - z) * (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 (y <= -2.6e+185) {
tmp = (x / y) / (t - z);
} else {
tmp = x / ((t - z) * (y - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -2.6e+185: tmp = (x / y) / (t - z) else: tmp = x / ((t - z) * (y - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.6e+185) tmp = Float64(Float64(x / y) / Float64(t - z)); else tmp = Float64(x / Float64(Float64(t - z) * 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 (y <= -2.6e+185)
tmp = (x / y) / (t - z);
else
tmp = x / ((t - z) * (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[y, -2.6e+185], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+185}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -2.60000000000000001e185Initial program 75.5%
Taylor expanded in x around 0 75.5%
associate-/l/95.1%
Simplified95.1%
Taylor expanded in y around inf 95.1%
if -2.60000000000000001e185 < y Initial program 92.9%
Final simplification93.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.85e+153) (/ (/ x y) t) (/ x (* t (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.85e+153) {
tmp = (x / y) / t;
} 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 (y <= (-1.85d+153)) then
tmp = (x / y) / t
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 (y <= -1.85e+153) {
tmp = (x / y) / t;
} 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 y <= -1.85e+153: tmp = (x / y) / t 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 (y <= -1.85e+153) tmp = Float64(Float64(x / y) / t); 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 (y <= -1.85e+153)
tmp = (x / y) / t;
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[y, -1.85e+153], N[(N[(x / y), $MachinePrecision] / t), $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}\;y \leq -1.85 \cdot 10^{+153}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -1.8500000000000001e153Initial program 79.0%
Taylor expanded in z around 0 45.9%
*-un-lft-identity45.9%
times-frac58.8%
Applied egg-rr58.8%
associate-*l/58.7%
*-lft-identity58.7%
Simplified58.7%
if -1.8500000000000001e153 < y Initial program 93.4%
Taylor expanded in t around inf 58.4%
Final simplification58.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ 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 91.7%
Taylor expanded in z around 0 38.3%
Final simplification38.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 2024074
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:alt
(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))))