
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ (/ x (- t z)) (- y z)))
assert(y < t);
double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / (t - z)) / (y - z)
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return (x / (t - z)) / (y - z)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(t - z)) / Float64(y - z)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (t - z)) / (y - z);
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\frac{\frac{x}{t - z}}{y - z}
\end{array}
Initial program 87.7%
associate-/l/96.9%
Simplified96.9%
Final simplification96.9%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* (- t z) y))))
(if (<= t -1.35e-260)
t_1
(if (<= t 6.5e-271)
(/ (/ x z) z)
(if (<= t 2.3e-83)
t_1
(if (<= t 4.6e+185) (/ x (* t (- y z))) (/ (/ x t) (- y z))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = x / ((t - z) * y);
double tmp;
if (t <= -1.35e-260) {
tmp = t_1;
} else if (t <= 6.5e-271) {
tmp = (x / z) / z;
} else if (t <= 2.3e-83) {
tmp = t_1;
} else if (t <= 4.6e+185) {
tmp = x / (t * (y - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / ((t - z) * y)
if (t <= (-1.35d-260)) then
tmp = t_1
else if (t <= 6.5d-271) then
tmp = (x / z) / z
else if (t <= 2.3d-83) then
tmp = t_1
else if (t <= 4.6d+185) then
tmp = x / (t * (y - z))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = x / ((t - z) * y);
double tmp;
if (t <= -1.35e-260) {
tmp = t_1;
} else if (t <= 6.5e-271) {
tmp = (x / z) / z;
} else if (t <= 2.3e-83) {
tmp = t_1;
} else if (t <= 4.6e+185) {
tmp = x / (t * (y - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = x / ((t - z) * y) tmp = 0 if t <= -1.35e-260: tmp = t_1 elif t <= 6.5e-271: tmp = (x / z) / z elif t <= 2.3e-83: tmp = t_1 elif t <= 4.6e+185: tmp = x / (t * (y - z)) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(t - z) * y)) tmp = 0.0 if (t <= -1.35e-260) tmp = t_1; elseif (t <= 6.5e-271) tmp = Float64(Float64(x / z) / z); elseif (t <= 2.3e-83) tmp = t_1; elseif (t <= 4.6e+185) tmp = Float64(x / Float64(t * Float64(y - z))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = x / ((t - z) * y);
tmp = 0.0;
if (t <= -1.35e-260)
tmp = t_1;
elseif (t <= 6.5e-271)
tmp = (x / z) / z;
elseif (t <= 2.3e-83)
tmp = t_1;
elseif (t <= 4.6e+185)
tmp = x / (t * (y - z));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.35e-260], t$95$1, If[LessEqual[t, 6.5e-271], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 2.3e-83], t$95$1, If[LessEqual[t, 4.6e+185], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{-260}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-271}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+185}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.35000000000000003e-260 or 6.5000000000000005e-271 < t < 2.2999999999999999e-83Initial program 89.1%
Taylor expanded in y around inf 61.8%
*-commutative61.8%
Simplified61.8%
if -1.35000000000000003e-260 < t < 6.5000000000000005e-271Initial program 84.6%
Taylor expanded in z around inf 58.4%
unpow258.4%
associate-/r*67.2%
Simplified67.2%
if 2.2999999999999999e-83 < t < 4.6000000000000003e185Initial program 92.6%
Taylor expanded in t around inf 85.0%
if 4.6000000000000003e185 < t Initial program 75.2%
associate-/l/98.8%
Simplified98.8%
Taylor expanded in t around inf 98.8%
Final simplification70.3%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)))
(if (<= z -5.4e+41)
t_1
(if (<= z -4.2e-171)
(/ x (* t (- y z)))
(if (<= z 2e+69) (/ x (* (- t z) y)) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -5.4e+41) {
tmp = t_1;
} else if (z <= -4.2e-171) {
tmp = x / (t * (y - z));
} else if (z <= 2e+69) {
tmp = x / ((t - z) * y);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) / z
if (z <= (-5.4d+41)) then
tmp = t_1
else if (z <= (-4.2d-171)) then
tmp = x / (t * (y - z))
else if (z <= 2d+69) then
tmp = x / ((t - z) * y)
else
tmp = t_1
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -5.4e+41) {
tmp = t_1;
} else if (z <= -4.2e-171) {
tmp = x / (t * (y - z));
} else if (z <= 2e+69) {
tmp = x / ((t - z) * y);
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if z <= -5.4e+41: tmp = t_1 elif z <= -4.2e-171: tmp = x / (t * (y - z)) elif z <= 2e+69: tmp = x / ((t - z) * y) else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (z <= -5.4e+41) tmp = t_1; elseif (z <= -4.2e-171) tmp = Float64(x / Float64(t * Float64(y - z))); elseif (z <= 2e+69) tmp = Float64(x / Float64(Float64(t - z) * y)); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
tmp = 0.0;
if (z <= -5.4e+41)
tmp = t_1;
elseif (z <= -4.2e-171)
tmp = x / (t * (y - z));
elseif (z <= 2e+69)
tmp = x / ((t - z) * y);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -5.4e+41], t$95$1, If[LessEqual[z, -4.2e-171], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+69], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -5.4 \cdot 10^{+41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-171}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+69}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.39999999999999999e41 or 2.0000000000000001e69 < z Initial program 76.3%
Taylor expanded in z around inf 71.6%
unpow271.6%
associate-/r*81.8%
Simplified81.8%
if -5.39999999999999999e41 < z < -4.2e-171Initial program 91.4%
Taylor expanded in t around inf 58.4%
if -4.2e-171 < z < 2.0000000000000001e69Initial program 96.2%
Taylor expanded in y around inf 74.6%
*-commutative74.6%
Simplified74.6%
Final simplification73.8%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t -1.7e-135)
(/ x (* (- t z) y))
(if (<= t 1.25e-23)
(/ (- x) (* z (- y z)))
(if (<= t 4.8e+185) (/ x (* t (- y z))) (/ (/ x t) (- y z))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.7e-135) {
tmp = x / ((t - z) * y);
} else if (t <= 1.25e-23) {
tmp = -x / (z * (y - z));
} else if (t <= 4.8e+185) {
tmp = x / (t * (y - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.7d-135)) then
tmp = x / ((t - z) * y)
else if (t <= 1.25d-23) then
tmp = -x / (z * (y - z))
else if (t <= 4.8d+185) then
tmp = x / (t * (y - z))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.7e-135) {
tmp = x / ((t - z) * y);
} else if (t <= 1.25e-23) {
tmp = -x / (z * (y - z));
} else if (t <= 4.8e+185) {
tmp = x / (t * (y - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= -1.7e-135: tmp = x / ((t - z) * y) elif t <= 1.25e-23: tmp = -x / (z * (y - z)) elif t <= 4.8e+185: tmp = x / (t * (y - z)) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -1.7e-135) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (t <= 1.25e-23) tmp = Float64(Float64(-x) / Float64(z * Float64(y - z))); elseif (t <= 4.8e+185) tmp = Float64(x / Float64(t * Float64(y - z))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -1.7e-135)
tmp = x / ((t - z) * y);
elseif (t <= 1.25e-23)
tmp = -x / (z * (y - z));
elseif (t <= 4.8e+185)
tmp = x / (t * (y - z));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -1.7e-135], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e-23], N[((-x) / N[(z * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e+185], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{-135}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{-23}:\\
\;\;\;\;\frac{-x}{z \cdot \left(y - z\right)}\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+185}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.69999999999999995e-135Initial program 91.6%
Taylor expanded in y around inf 60.5%
*-commutative60.5%
Simplified60.5%
if -1.69999999999999995e-135 < t < 1.2500000000000001e-23Initial program 85.3%
Taylor expanded in t around 0 76.9%
associate-*r/76.9%
neg-mul-176.9%
*-commutative76.9%
Simplified76.9%
if 1.2500000000000001e-23 < t < 4.79999999999999978e185Initial program 94.6%
Taylor expanded in t around inf 86.4%
if 4.79999999999999978e185 < t Initial program 75.2%
associate-/l/98.8%
Simplified98.8%
Taylor expanded in t around inf 98.8%
Final simplification75.0%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t -1.25e-132)
(/ x (* (- t z) y))
(if (<= t 3.3e-26)
(/ (/ (- x) z) (- y z))
(if (<= t 5.5e+185) (/ x (* t (- y z))) (/ (/ x t) (- y z))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.25e-132) {
tmp = x / ((t - z) * y);
} else if (t <= 3.3e-26) {
tmp = (-x / z) / (y - z);
} else if (t <= 5.5e+185) {
tmp = x / (t * (y - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.25d-132)) then
tmp = x / ((t - z) * y)
else if (t <= 3.3d-26) then
tmp = (-x / z) / (y - z)
else if (t <= 5.5d+185) then
tmp = x / (t * (y - z))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.25e-132) {
tmp = x / ((t - z) * y);
} else if (t <= 3.3e-26) {
tmp = (-x / z) / (y - z);
} else if (t <= 5.5e+185) {
tmp = x / (t * (y - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= -1.25e-132: tmp = x / ((t - z) * y) elif t <= 3.3e-26: tmp = (-x / z) / (y - z) elif t <= 5.5e+185: tmp = x / (t * (y - z)) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -1.25e-132) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (t <= 3.3e-26) tmp = Float64(Float64(Float64(-x) / z) / Float64(y - z)); elseif (t <= 5.5e+185) tmp = Float64(x / Float64(t * Float64(y - z))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -1.25e-132)
tmp = x / ((t - z) * y);
elseif (t <= 3.3e-26)
tmp = (-x / z) / (y - z);
elseif (t <= 5.5e+185)
tmp = x / (t * (y - z));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -1.25e-132], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e-26], N[(N[((-x) / z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e+185], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{-132}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{-26}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y - z}\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+185}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.25e-132Initial program 91.6%
Taylor expanded in y around inf 60.5%
*-commutative60.5%
Simplified60.5%
if -1.25e-132 < t < 3.2999999999999998e-26Initial program 85.3%
Taylor expanded in t around 0 76.9%
associate-*r/76.9%
neg-mul-176.9%
*-commutative76.9%
associate-/r*88.4%
distribute-frac-neg88.4%
Simplified88.4%
if 3.2999999999999998e-26 < t < 5.4999999999999996e185Initial program 94.6%
Taylor expanded in t around inf 86.4%
if 5.4999999999999996e185 < t Initial program 75.2%
associate-/l/98.8%
Simplified98.8%
Taylor expanded in t around inf 98.8%
Final simplification79.2%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -2.2e+122) (not (<= z 1.1e+128))) (/ (/ (- x) z) (- t z)) (/ x (* (- t z) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.2e+122) || !(z <= 1.1e+128)) {
tmp = (-x / z) / (t - z);
} else {
tmp = x / ((t - z) * (y - z));
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.2d+122)) .or. (.not. (z <= 1.1d+128))) then
tmp = (-x / z) / (t - z)
else
tmp = x / ((t - z) * (y - z))
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.2e+122) || !(z <= 1.1e+128)) {
tmp = (-x / z) / (t - z);
} else {
tmp = x / ((t - z) * (y - z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -2.2e+122) or not (z <= 1.1e+128): tmp = (-x / z) / (t - z) else: tmp = x / ((t - z) * (y - z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -2.2e+122) || !(z <= 1.1e+128)) tmp = Float64(Float64(Float64(-x) / z) / Float64(t - z)); else tmp = Float64(x / Float64(Float64(t - z) * Float64(y - z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -2.2e+122) || ~((z <= 1.1e+128)))
tmp = (-x / z) / (t - z);
else
tmp = x / ((t - z) * (y - z));
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.2e+122], N[Not[LessEqual[z, 1.1e+128]], $MachinePrecision]], N[(N[((-x) / z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+122} \lor \neg \left(z \leq 1.1 \cdot 10^{+128}\right):\\
\;\;\;\;\frac{\frac{-x}{z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if z < -2.1999999999999999e122 or 1.10000000000000008e128 < z Initial program 72.5%
Taylor expanded in y around 0 72.5%
mul-1-neg72.5%
associate-/r*91.0%
distribute-neg-frac91.0%
Simplified91.0%
if -2.1999999999999999e122 < z < 1.10000000000000008e128Initial program 93.3%
Final simplification92.7%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)))
(if (<= z -1.42e+54)
t_1
(if (<= z 6.8e-17)
(/ (/ x t) y)
(if (<= z 1.5e+68) (/ (- x) (* z y)) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -1.42e+54) {
tmp = t_1;
} else if (z <= 6.8e-17) {
tmp = (x / t) / y;
} else if (z <= 1.5e+68) {
tmp = -x / (z * y);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) / z
if (z <= (-1.42d+54)) then
tmp = t_1
else if (z <= 6.8d-17) then
tmp = (x / t) / y
else if (z <= 1.5d+68) then
tmp = -x / (z * y)
else
tmp = t_1
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -1.42e+54) {
tmp = t_1;
} else if (z <= 6.8e-17) {
tmp = (x / t) / y;
} else if (z <= 1.5e+68) {
tmp = -x / (z * y);
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if z <= -1.42e+54: tmp = t_1 elif z <= 6.8e-17: tmp = (x / t) / y elif z <= 1.5e+68: tmp = -x / (z * y) else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (z <= -1.42e+54) tmp = t_1; elseif (z <= 6.8e-17) tmp = Float64(Float64(x / t) / y); elseif (z <= 1.5e+68) tmp = Float64(Float64(-x) / Float64(z * y)); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
tmp = 0.0;
if (z <= -1.42e+54)
tmp = t_1;
elseif (z <= 6.8e-17)
tmp = (x / t) / y;
elseif (z <= 1.5e+68)
tmp = -x / (z * y);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -1.42e+54], t$95$1, If[LessEqual[z, 6.8e-17], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1.5e+68], N[((-x) / N[(z * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -1.42 \cdot 10^{+54}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+68}:\\
\;\;\;\;\frac{-x}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.41999999999999995e54 or 1.5000000000000001e68 < z Initial program 77.5%
Taylor expanded in z around inf 72.8%
unpow272.8%
associate-/r*83.4%
Simplified83.4%
if -1.41999999999999995e54 < z < 6.7999999999999996e-17Initial program 92.5%
Taylor expanded in z around 0 54.6%
associate-/r*59.4%
div-inv59.3%
Applied egg-rr59.3%
associate-*l/59.8%
un-div-inv59.8%
Applied egg-rr59.8%
if 6.7999999999999996e-17 < z < 1.5000000000000001e68Initial program 99.7%
Taylor expanded in t around 0 56.8%
associate-*r/56.8%
neg-mul-156.8%
*-commutative56.8%
Simplified56.8%
Taylor expanded in z around 0 33.6%
Final simplification66.1%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)))
(if (<= z -5.5e+55)
t_1
(if (<= z 6.8e-17)
(/ (/ x t) y)
(if (<= z 2.2e+68) (/ (/ (- x) z) y) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -5.5e+55) {
tmp = t_1;
} else if (z <= 6.8e-17) {
tmp = (x / t) / y;
} else if (z <= 2.2e+68) {
tmp = (-x / z) / y;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) / z
if (z <= (-5.5d+55)) then
tmp = t_1
else if (z <= 6.8d-17) then
tmp = (x / t) / y
else if (z <= 2.2d+68) then
tmp = (-x / z) / y
else
tmp = t_1
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -5.5e+55) {
tmp = t_1;
} else if (z <= 6.8e-17) {
tmp = (x / t) / y;
} else if (z <= 2.2e+68) {
tmp = (-x / z) / y;
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if z <= -5.5e+55: tmp = t_1 elif z <= 6.8e-17: tmp = (x / t) / y elif z <= 2.2e+68: tmp = (-x / z) / y else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (z <= -5.5e+55) tmp = t_1; elseif (z <= 6.8e-17) tmp = Float64(Float64(x / t) / y); elseif (z <= 2.2e+68) tmp = Float64(Float64(Float64(-x) / z) / y); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
tmp = 0.0;
if (z <= -5.5e+55)
tmp = t_1;
elseif (z <= 6.8e-17)
tmp = (x / t) / y;
elseif (z <= 2.2e+68)
tmp = (-x / z) / y;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -5.5e+55], t$95$1, If[LessEqual[z, 6.8e-17], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 2.2e+68], N[(N[((-x) / z), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+68}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.5000000000000004e55 or 2.19999999999999987e68 < z Initial program 77.5%
Taylor expanded in z around inf 72.8%
unpow272.8%
associate-/r*83.4%
Simplified83.4%
if -5.5000000000000004e55 < z < 6.7999999999999996e-17Initial program 92.5%
Taylor expanded in z around 0 54.6%
associate-/r*59.4%
div-inv59.3%
Applied egg-rr59.3%
associate-*l/59.8%
un-div-inv59.8%
Applied egg-rr59.8%
if 6.7999999999999996e-17 < z < 2.19999999999999987e68Initial program 99.7%
Taylor expanded in t around 0 56.8%
associate-*r/56.8%
neg-mul-156.8%
*-commutative56.8%
Simplified56.8%
Taylor expanded in z around 0 33.6%
mul-1-neg33.6%
associate-/r*33.7%
distribute-neg-frac33.7%
distribute-neg-frac33.7%
Simplified33.7%
Taylor expanded in x around 0 33.6%
mul-1-neg33.6%
*-commutative33.6%
distribute-neg-frac33.6%
Simplified33.6%
Taylor expanded in x around 0 33.6%
mul-1-neg33.6%
associate-/l/33.6%
distribute-neg-frac33.6%
Simplified33.6%
Final simplification66.1%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)))
(if (<= z -5.5e+55)
t_1
(if (<= z 6.8e-17)
(/ (/ x t) y)
(if (<= z 1.75e+68) (/ (/ (- x) y) z) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -5.5e+55) {
tmp = t_1;
} else if (z <= 6.8e-17) {
tmp = (x / t) / y;
} else if (z <= 1.75e+68) {
tmp = (-x / y) / z;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) / z
if (z <= (-5.5d+55)) then
tmp = t_1
else if (z <= 6.8d-17) then
tmp = (x / t) / y
else if (z <= 1.75d+68) then
tmp = (-x / y) / z
else
tmp = t_1
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -5.5e+55) {
tmp = t_1;
} else if (z <= 6.8e-17) {
tmp = (x / t) / y;
} else if (z <= 1.75e+68) {
tmp = (-x / y) / z;
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if z <= -5.5e+55: tmp = t_1 elif z <= 6.8e-17: tmp = (x / t) / y elif z <= 1.75e+68: tmp = (-x / y) / z else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (z <= -5.5e+55) tmp = t_1; elseif (z <= 6.8e-17) tmp = Float64(Float64(x / t) / y); elseif (z <= 1.75e+68) tmp = Float64(Float64(Float64(-x) / y) / z); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
tmp = 0.0;
if (z <= -5.5e+55)
tmp = t_1;
elseif (z <= 6.8e-17)
tmp = (x / t) / y;
elseif (z <= 1.75e+68)
tmp = (-x / y) / z;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -5.5e+55], t$95$1, If[LessEqual[z, 6.8e-17], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1.75e+68], N[(N[((-x) / y), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+68}:\\
\;\;\;\;\frac{\frac{-x}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.5000000000000004e55 or 1.74999999999999989e68 < z Initial program 77.5%
Taylor expanded in z around inf 72.8%
unpow272.8%
associate-/r*83.4%
Simplified83.4%
if -5.5000000000000004e55 < z < 6.7999999999999996e-17Initial program 92.5%
Taylor expanded in z around 0 54.6%
associate-/r*59.4%
div-inv59.3%
Applied egg-rr59.3%
associate-*l/59.8%
un-div-inv59.8%
Applied egg-rr59.8%
if 6.7999999999999996e-17 < z < 1.74999999999999989e68Initial program 99.7%
Taylor expanded in t around 0 56.8%
associate-*r/56.8%
neg-mul-156.8%
*-commutative56.8%
Simplified56.8%
Taylor expanded in z around 0 33.6%
mul-1-neg33.6%
associate-/r*33.7%
distribute-neg-frac33.7%
distribute-neg-frac33.7%
Simplified33.7%
Final simplification66.1%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -3.2e+41) (not (<= z 2.8e+20))) (/ (/ x z) z) (/ x (* t (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.2e+41) || !(z <= 2.8e+20)) {
tmp = (x / z) / z;
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.2d+41)) .or. (.not. (z <= 2.8d+20))) then
tmp = (x / z) / z
else
tmp = x / (t * (y - z))
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.2e+41) || !(z <= 2.8e+20)) {
tmp = (x / z) / z;
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -3.2e+41) or not (z <= 2.8e+20): tmp = (x / z) / z else: tmp = x / (t * (y - z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -3.2e+41) || !(z <= 2.8e+20)) tmp = Float64(Float64(x / z) / z); else tmp = Float64(x / Float64(t * Float64(y - z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -3.2e+41) || ~((z <= 2.8e+20)))
tmp = (x / z) / z;
else
tmp = x / (t * (y - z));
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.2e+41], N[Not[LessEqual[z, 2.8e+20]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+41} \lor \neg \left(z \leq 2.8 \cdot 10^{+20}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if z < -3.2000000000000001e41 or 2.8e20 < z Initial program 78.7%
Taylor expanded in z around inf 68.4%
unpow268.4%
associate-/r*77.6%
Simplified77.6%
if -3.2000000000000001e41 < z < 2.8e20Initial program 94.1%
Taylor expanded in t around inf 69.0%
Final simplification72.6%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -8e+108) (not (<= z 7.4e+46))) (/ x (* z y)) (/ x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e+108) || !(z <= 7.4e+46)) {
tmp = x / (z * y);
} else {
tmp = x / (t * y);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-8d+108)) .or. (.not. (z <= 7.4d+46))) then
tmp = x / (z * y)
else
tmp = x / (t * y)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e+108) || !(z <= 7.4e+46)) {
tmp = x / (z * y);
} else {
tmp = x / (t * y);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -8e+108) or not (z <= 7.4e+46): tmp = x / (z * y) else: tmp = x / (t * y) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -8e+108) || !(z <= 7.4e+46)) tmp = Float64(x / Float64(z * y)); else tmp = Float64(x / Float64(t * y)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -8e+108) || ~((z <= 7.4e+46)))
tmp = x / (z * y);
else
tmp = x / (t * y);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8e+108], N[Not[LessEqual[z, 7.4e+46]], $MachinePrecision]], N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+108} \lor \neg \left(z \leq 7.4 \cdot 10^{+46}\right):\\
\;\;\;\;\frac{x}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -8.0000000000000003e108 or 7.3999999999999998e46 < z Initial program 75.7%
Taylor expanded in t around 0 71.7%
associate-*r/71.7%
neg-mul-171.7%
*-commutative71.7%
Simplified71.7%
Taylor expanded in z around 0 45.1%
mul-1-neg45.1%
associate-/r*47.4%
distribute-neg-frac47.4%
distribute-neg-frac47.4%
Simplified47.4%
expm1-log1p-u47.2%
expm1-udef65.1%
associate-/l/65.1%
add-sqr-sqrt31.8%
sqrt-unprod60.4%
sqr-neg60.4%
sqrt-unprod33.3%
add-sqr-sqrt65.0%
Applied egg-rr65.0%
expm1-def44.8%
expm1-log1p45.2%
Simplified45.2%
if -8.0000000000000003e108 < z < 7.3999999999999998e46Initial program 93.3%
Taylor expanded in z around 0 48.8%
Final simplification47.6%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -4.8e+32) (not (<= z 6.6e+14))) (/ x (* z z)) (/ x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.8e+32) || !(z <= 6.6e+14)) {
tmp = x / (z * z);
} else {
tmp = x / (t * y);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-4.8d+32)) .or. (.not. (z <= 6.6d+14))) then
tmp = x / (z * z)
else
tmp = x / (t * y)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.8e+32) || !(z <= 6.6e+14)) {
tmp = x / (z * z);
} else {
tmp = x / (t * y);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -4.8e+32) or not (z <= 6.6e+14): tmp = x / (z * z) else: tmp = x / (t * y) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -4.8e+32) || !(z <= 6.6e+14)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(x / Float64(t * y)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -4.8e+32) || ~((z <= 6.6e+14)))
tmp = x / (z * z);
else
tmp = x / (t * y);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.8e+32], N[Not[LessEqual[z, 6.6e+14]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+32} \lor \neg \left(z \leq 6.6 \cdot 10^{+14}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -4.79999999999999983e32 or 6.6e14 < z Initial program 79.3%
Taylor expanded in z around inf 67.6%
unpow267.6%
Simplified67.6%
if -4.79999999999999983e32 < z < 6.6e14Initial program 94.0%
Taylor expanded in z around 0 54.8%
Final simplification60.3%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -1.42e+54) (not (<= z 7.2e+14))) (/ x (* z z)) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.42e+54) || !(z <= 7.2e+14)) {
tmp = x / (z * z);
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.42d+54)) .or. (.not. (z <= 7.2d+14))) then
tmp = x / (z * z)
else
tmp = (x / t) / y
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.42e+54) || !(z <= 7.2e+14)) {
tmp = x / (z * z);
} else {
tmp = (x / t) / y;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.42e+54) or not (z <= 7.2e+14): tmp = x / (z * z) else: tmp = (x / t) / y return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -1.42e+54) || !(z <= 7.2e+14)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(Float64(x / t) / y); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -1.42e+54) || ~((z <= 7.2e+14)))
tmp = x / (z * z);
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.42e+54], N[Not[LessEqual[z, 7.2e+14]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.42 \cdot 10^{+54} \lor \neg \left(z \leq 7.2 \cdot 10^{+14}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -1.41999999999999995e54 or 7.2e14 < z Initial program 80.4%
Taylor expanded in z around inf 68.5%
unpow268.5%
Simplified68.5%
if -1.41999999999999995e54 < z < 7.2e14Initial program 92.9%
Taylor expanded in z around 0 53.8%
associate-/r*58.3%
div-inv58.3%
Applied egg-rr58.3%
associate-*l/59.3%
un-div-inv59.4%
Applied egg-rr59.4%
Final simplification63.2%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -1.12e+55) (not (<= z 8e+14))) (/ (/ x z) z) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.12e+55) || !(z <= 8e+14)) {
tmp = (x / z) / z;
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.12d+55)) .or. (.not. (z <= 8d+14))) then
tmp = (x / z) / z
else
tmp = (x / t) / y
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.12e+55) || !(z <= 8e+14)) {
tmp = (x / z) / z;
} else {
tmp = (x / t) / y;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.12e+55) or not (z <= 8e+14): tmp = (x / z) / z else: tmp = (x / t) / y return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -1.12e+55) || !(z <= 8e+14)) tmp = Float64(Float64(x / z) / z); else tmp = Float64(Float64(x / t) / y); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -1.12e+55) || ~((z <= 8e+14)))
tmp = (x / z) / z;
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.12e+55], N[Not[LessEqual[z, 8e+14]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{+55} \lor \neg \left(z \leq 8 \cdot 10^{+14}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -1.12000000000000006e55 or 8e14 < z Initial program 80.4%
Taylor expanded in z around inf 68.5%
unpow268.5%
associate-/r*77.7%
Simplified77.7%
if -1.12000000000000006e55 < z < 8e14Initial program 92.9%
Taylor expanded in z around 0 53.8%
associate-/r*58.3%
div-inv58.3%
Applied egg-rr58.3%
associate-*l/59.3%
un-div-inv59.4%
Applied egg-rr59.4%
Final simplification67.0%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* t y)))
assert(y < t);
double code(double x, double y, double z, double t) {
return x / (t * y);
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / (t * y)
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
return x / (t * y);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return x / (t * y)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(x / Float64(t * y)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = x / (t * y);
end
NOTE: y 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}
[y, t] = \mathsf{sort}([y, t])\\
\\
\frac{x}{t \cdot y}
\end{array}
Initial program 87.7%
Taylor expanded in z around 0 42.0%
Final simplification42.0%
(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 2023199
(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))))