
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (* (- y z) (- t z))))) (if (<= t_1 0.0) (/ (/ x (- y z)) (- t z)) t_1)))
assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (t - z));
double tmp;
if (t_1 <= 0.0) {
tmp = (x / (y - z)) / (t - 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 / ((y - z) * (t - z))
if (t_1 <= 0.0d0) then
tmp = (x / (y - z)) / (t - 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 / ((y - z) * (t - z));
double tmp;
if (t_1 <= 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = x / ((y - z) * (t - z)) tmp = 0 if t_1 <= 0.0: tmp = (x / (y - z)) / (t - z) else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(y - z) * Float64(t - z))) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - 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 / ((y - z) * (t - z));
tmp = 0.0;
if (t_1 <= 0.0)
tmp = (x / (y - z)) / (t - 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[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{if}\;t_1 \leq 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -0.0Initial program 90.0%
associate-/r*98.3%
Simplified98.3%
if -0.0 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 98.2%
Final simplification98.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 (- t z)))))
(if (<= z -0.00047)
t_1
(if (<= z 1.35e-9)
(/ x (* (- y z) t))
(if (<= z 1.4e+154) t_1 (/ 1.0 (/ z (/ x z))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = -x / (z * (t - z));
double tmp;
if (z <= -0.00047) {
tmp = t_1;
} else if (z <= 1.35e-9) {
tmp = x / ((y - z) * t);
} else if (z <= 1.4e+154) {
tmp = t_1;
} else {
tmp = 1.0 / (z / (x / 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 / (z * (t - z))
if (z <= (-0.00047d0)) then
tmp = t_1
else if (z <= 1.35d-9) then
tmp = x / ((y - z) * t)
else if (z <= 1.4d+154) then
tmp = t_1
else
tmp = 1.0d0 / (z / (x / 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 / (z * (t - z));
double tmp;
if (z <= -0.00047) {
tmp = t_1;
} else if (z <= 1.35e-9) {
tmp = x / ((y - z) * t);
} else if (z <= 1.4e+154) {
tmp = t_1;
} else {
tmp = 1.0 / (z / (x / z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = -x / (z * (t - z)) tmp = 0 if z <= -0.00047: tmp = t_1 elif z <= 1.35e-9: tmp = x / ((y - z) * t) elif z <= 1.4e+154: tmp = t_1 else: tmp = 1.0 / (z / (x / z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(-x) / Float64(z * Float64(t - z))) tmp = 0.0 if (z <= -0.00047) tmp = t_1; elseif (z <= 1.35e-9) tmp = Float64(x / Float64(Float64(y - z) * t)); elseif (z <= 1.4e+154) tmp = t_1; else tmp = Float64(1.0 / Float64(z / Float64(x / z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = -x / (z * (t - z));
tmp = 0.0;
if (z <= -0.00047)
tmp = t_1;
elseif (z <= 1.35e-9)
tmp = x / ((y - z) * t);
elseif (z <= 1.4e+154)
tmp = t_1;
else
tmp = 1.0 / (z / (x / 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[(z * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.00047], t$95$1, If[LessEqual[z, 1.35e-9], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e+154], t$95$1, N[(1.0 / N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{-x}{z \cdot \left(t - z\right)}\\
\mathbf{if}\;z \leq -0.00047:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-9}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{z}{\frac{x}{z}}}\\
\end{array}
\end{array}
if z < -4.69999999999999986e-4 or 1.3500000000000001e-9 < z < 1.4e154Initial program 93.1%
Taylor expanded in y around 0 87.4%
associate-*r/87.4%
neg-mul-187.4%
Simplified87.4%
if -4.69999999999999986e-4 < z < 1.3500000000000001e-9Initial program 94.2%
Taylor expanded in t around inf 77.8%
if 1.4e154 < z Initial program 84.3%
associate-/l/99.9%
div-inv99.9%
Applied egg-rr99.9%
clear-num99.9%
frac-times99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 84.3%
unpow284.3%
associate-/l*98.9%
Simplified98.9%
Final simplification84.4%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -0.00017) (not (<= z 3.8e-11))) (/ (/ (- x) z) (- t z)) (/ x (* (- y z) t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.00017) || !(z <= 3.8e-11)) {
tmp = (-x / z) / (t - z);
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-0.00017d0)) .or. (.not. (z <= 3.8d-11))) then
tmp = (-x / z) / (t - z)
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.00017) || !(z <= 3.8e-11)) {
tmp = (-x / z) / (t - z);
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -0.00017) or not (z <= 3.8e-11): tmp = (-x / z) / (t - z) else: tmp = x / ((y - z) * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -0.00017) || !(z <= 3.8e-11)) tmp = Float64(Float64(Float64(-x) / z) / Float64(t - z)); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -0.00017) || ~((z <= 3.8e-11)))
tmp = (-x / z) / (t - z);
else
tmp = x / ((y - z) * t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.00017], N[Not[LessEqual[z, 3.8e-11]], $MachinePrecision]], N[(N[((-x) / z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00017 \lor \neg \left(z \leq 3.8 \cdot 10^{-11}\right):\\
\;\;\;\;\frac{\frac{-x}{z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if z < -1.7e-4 or 3.7999999999999998e-11 < z Initial program 90.2%
Taylor expanded in y around 0 86.3%
mul-1-neg86.3%
distribute-frac-neg86.3%
associate-/r*93.5%
Simplified93.5%
if -1.7e-4 < z < 3.7999999999999998e-11Initial program 94.2%
Taylor expanded in t around inf 77.8%
Final simplification85.5%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -0.009) (/ (/ x z) z) (if (<= z 3.5e-9) (/ (/ x t) y) (/ 1.0 (/ z (/ x z))))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.009) {
tmp = (x / z) / z;
} else if (z <= 3.5e-9) {
tmp = (x / t) / y;
} else {
tmp = 1.0 / (z / (x / 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 <= (-0.009d0)) then
tmp = (x / z) / z
else if (z <= 3.5d-9) then
tmp = (x / t) / y
else
tmp = 1.0d0 / (z / (x / 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 <= -0.009) {
tmp = (x / z) / z;
} else if (z <= 3.5e-9) {
tmp = (x / t) / y;
} else {
tmp = 1.0 / (z / (x / z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -0.009: tmp = (x / z) / z elif z <= 3.5e-9: tmp = (x / t) / y else: tmp = 1.0 / (z / (x / z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -0.009) tmp = Float64(Float64(x / z) / z); elseif (z <= 3.5e-9) tmp = Float64(Float64(x / t) / y); else tmp = Float64(1.0 / Float64(z / Float64(x / z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -0.009)
tmp = (x / z) / z;
elseif (z <= 3.5e-9)
tmp = (x / t) / y;
else
tmp = 1.0 / (z / (x / 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[z, -0.009], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 3.5e-9], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.009:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-9}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{z}{\frac{x}{z}}}\\
\end{array}
\end{array}
if z < -0.00899999999999999932Initial program 94.3%
Taylor expanded in z around inf 84.9%
unpow284.9%
associate-/r*86.9%
Simplified86.9%
if -0.00899999999999999932 < z < 3.4999999999999999e-9Initial program 94.2%
Taylor expanded in z around 0 68.2%
*-un-lft-identity68.2%
times-frac70.2%
Applied egg-rr70.2%
associate-*l/70.3%
*-lft-identity70.3%
Simplified70.3%
if 3.4999999999999999e-9 < z Initial program 87.4%
associate-/l/99.8%
div-inv99.8%
Applied egg-rr99.8%
clear-num99.6%
frac-times99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 75.8%
unpow275.8%
associate-/l*83.9%
Simplified83.9%
Final simplification77.5%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -0.0026) (/ (/ x z) z) (if (<= z 4.2e+49) (/ x (* (- y z) t)) (/ 1.0 (/ z (/ x z))))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.0026) {
tmp = (x / z) / z;
} else if (z <= 4.2e+49) {
tmp = x / ((y - z) * t);
} else {
tmp = 1.0 / (z / (x / 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 <= (-0.0026d0)) then
tmp = (x / z) / z
else if (z <= 4.2d+49) then
tmp = x / ((y - z) * t)
else
tmp = 1.0d0 / (z / (x / 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 <= -0.0026) {
tmp = (x / z) / z;
} else if (z <= 4.2e+49) {
tmp = x / ((y - z) * t);
} else {
tmp = 1.0 / (z / (x / z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -0.0026: tmp = (x / z) / z elif z <= 4.2e+49: tmp = x / ((y - z) * t) else: tmp = 1.0 / (z / (x / z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -0.0026) tmp = Float64(Float64(x / z) / z); elseif (z <= 4.2e+49) tmp = Float64(x / Float64(Float64(y - z) * t)); else tmp = Float64(1.0 / Float64(z / Float64(x / z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -0.0026)
tmp = (x / z) / z;
elseif (z <= 4.2e+49)
tmp = x / ((y - z) * t);
else
tmp = 1.0 / (z / (x / 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[z, -0.0026], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 4.2e+49], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0026:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+49}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{z}{\frac{x}{z}}}\\
\end{array}
\end{array}
if z < -0.0025999999999999999Initial program 94.3%
Taylor expanded in z around inf 84.9%
unpow284.9%
associate-/r*86.9%
Simplified86.9%
if -0.0025999999999999999 < z < 4.20000000000000022e49Initial program 93.9%
Taylor expanded in t around inf 75.8%
if 4.20000000000000022e49 < z Initial program 87.2%
associate-/l/99.9%
div-inv99.8%
Applied egg-rr99.8%
clear-num99.7%
frac-times99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 81.3%
unpow281.3%
associate-/l*90.6%
Simplified90.6%
Final simplification81.8%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -0.007) (/ (/ x z) z) (if (<= z 2.85e+48) (/ (/ x t) (- y z)) (/ 1.0 (/ z (/ x z))))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.007) {
tmp = (x / z) / z;
} else if (z <= 2.85e+48) {
tmp = (x / t) / (y - z);
} else {
tmp = 1.0 / (z / (x / 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 <= (-0.007d0)) then
tmp = (x / z) / z
else if (z <= 2.85d+48) then
tmp = (x / t) / (y - z)
else
tmp = 1.0d0 / (z / (x / 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 <= -0.007) {
tmp = (x / z) / z;
} else if (z <= 2.85e+48) {
tmp = (x / t) / (y - z);
} else {
tmp = 1.0 / (z / (x / z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -0.007: tmp = (x / z) / z elif z <= 2.85e+48: tmp = (x / t) / (y - z) else: tmp = 1.0 / (z / (x / z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -0.007) tmp = Float64(Float64(x / z) / z); elseif (z <= 2.85e+48) tmp = Float64(Float64(x / t) / Float64(y - z)); else tmp = Float64(1.0 / Float64(z / Float64(x / z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -0.007)
tmp = (x / z) / z;
elseif (z <= 2.85e+48)
tmp = (x / t) / (y - z);
else
tmp = 1.0 / (z / (x / 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[z, -0.007], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 2.85e+48], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.007:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{+48}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{z}{\frac{x}{z}}}\\
\end{array}
\end{array}
if z < -0.00700000000000000015Initial program 94.3%
Taylor expanded in z around inf 84.9%
unpow284.9%
associate-/r*86.9%
Simplified86.9%
if -0.00700000000000000015 < z < 2.84999999999999984e48Initial program 93.9%
associate-/l/95.0%
Simplified95.0%
Taylor expanded in t around inf 77.3%
if 2.84999999999999984e48 < z Initial program 87.2%
associate-/l/99.9%
div-inv99.8%
Applied egg-rr99.8%
clear-num99.7%
frac-times99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 81.3%
unpow281.3%
associate-/l*90.6%
Simplified90.6%
Final simplification82.6%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 5e+106) (/ x (* (- y z) (- t z))) (/ (/ (- x) z) (- t z))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5e+106) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (-x / z) / (t - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 5d+106) then
tmp = x / ((y - z) * (t - z))
else
tmp = (-x / z) / (t - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5e+106) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (-x / z) / (t - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= 5e+106: tmp = x / ((y - z) * (t - z)) else: tmp = (-x / z) / (t - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 5e+106) tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(Float64(-x) / z) / Float64(t - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 5e+106)
tmp = x / ((y - z) * (t - z));
else
tmp = (-x / z) / (t - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 5e+106], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5 \cdot 10^{+106}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-x}{z}}{t - z}\\
\end{array}
\end{array}
if z < 4.9999999999999998e106Initial program 94.3%
if 4.9999999999999998e106 < z Initial program 84.6%
Taylor expanded in y around 0 84.5%
mul-1-neg84.5%
distribute-frac-neg84.5%
associate-/r*95.8%
Simplified95.8%
Final simplification94.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 -0.0052) (not (<= z 3.2e+93))) (/ x (* y z)) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.0052) || !(z <= 3.2e+93)) {
tmp = x / (y * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-0.0052d0)) .or. (.not. (z <= 3.2d+93))) then
tmp = x / (y * z)
else
tmp = x / (y * t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.0052) || !(z <= 3.2e+93)) {
tmp = x / (y * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -0.0052) or not (z <= 3.2e+93): tmp = x / (y * z) else: tmp = x / (y * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -0.0052) || !(z <= 3.2e+93)) tmp = Float64(x / Float64(y * z)); else tmp = Float64(x / Float64(y * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -0.0052) || ~((z <= 3.2e+93)))
tmp = x / (y * z);
else
tmp = x / (y * t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.0052], N[Not[LessEqual[z, 3.2e+93]], $MachinePrecision]], N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0052 \lor \neg \left(z \leq 3.2 \cdot 10^{+93}\right):\\
\;\;\;\;\frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -0.0051999999999999998 or 3.2000000000000001e93 < z Initial program 89.5%
Taylor expanded in y around inf 43.8%
*-commutative43.8%
associate-/r*49.0%
Simplified49.0%
Taylor expanded in t around 0 43.7%
associate-*r/43.7%
neg-mul-143.7%
Simplified43.7%
expm1-log1p-u43.4%
expm1-udef71.2%
add-sqr-sqrt34.6%
sqrt-unprod69.2%
sqr-neg69.2%
sqrt-unprod36.6%
add-sqr-sqrt71.2%
Applied egg-rr71.2%
expm1-def43.0%
expm1-log1p43.3%
*-commutative43.3%
Simplified43.3%
if -0.0051999999999999998 < z < 3.2000000000000001e93Initial program 94.2%
Taylor expanded in z around 0 62.7%
Final simplification54.5%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -0.0064) (not (<= z 1.9e-9))) (/ x (* z z)) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.0064) || !(z <= 1.9e-9)) {
tmp = x / (z * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-0.0064d0)) .or. (.not. (z <= 1.9d-9))) then
tmp = x / (z * z)
else
tmp = x / (y * t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.0064) || !(z <= 1.9e-9)) {
tmp = x / (z * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -0.0064) or not (z <= 1.9e-9): tmp = x / (z * z) else: tmp = x / (y * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -0.0064) || !(z <= 1.9e-9)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(x / Float64(y * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -0.0064) || ~((z <= 1.9e-9)))
tmp = x / (z * z);
else
tmp = x / (y * t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.0064], N[Not[LessEqual[z, 1.9e-9]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0064 \lor \neg \left(z \leq 1.9 \cdot 10^{-9}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -0.00640000000000000031 or 1.90000000000000006e-9 < z Initial program 90.2%
Taylor expanded in z around inf 79.4%
unpow279.4%
Simplified79.4%
if -0.00640000000000000031 < z < 1.90000000000000006e-9Initial program 94.2%
Taylor expanded in z around 0 68.2%
Final simplification73.7%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -0.00066) (not (<= z 5.5e-10))) (/ x (* z z)) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.00066) || !(z <= 5.5e-10)) {
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 <= (-0.00066d0)) .or. (.not. (z <= 5.5d-10))) 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 <= -0.00066) || !(z <= 5.5e-10)) {
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 <= -0.00066) or not (z <= 5.5e-10): 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 <= -0.00066) || !(z <= 5.5e-10)) 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 <= -0.00066) || ~((z <= 5.5e-10)))
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, -0.00066], N[Not[LessEqual[z, 5.5e-10]], $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 -0.00066 \lor \neg \left(z \leq 5.5 \cdot 10^{-10}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -6.6e-4 or 5.4999999999999996e-10 < z Initial program 90.2%
Taylor expanded in z around inf 79.4%
unpow279.4%
Simplified79.4%
if -6.6e-4 < z < 5.4999999999999996e-10Initial program 94.2%
Taylor expanded in z around 0 68.2%
*-un-lft-identity68.2%
times-frac70.2%
Applied egg-rr70.2%
associate-*l/70.3%
*-lft-identity70.3%
Simplified70.3%
Final simplification74.7%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -0.00155) (not (<= z 3.2e-10))) (/ (/ x z) z) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.00155) || !(z <= 3.2e-10)) {
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 <= (-0.00155d0)) .or. (.not. (z <= 3.2d-10))) 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 <= -0.00155) || !(z <= 3.2e-10)) {
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 <= -0.00155) or not (z <= 3.2e-10): 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 <= -0.00155) || !(z <= 3.2e-10)) 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 <= -0.00155) || ~((z <= 3.2e-10)))
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, -0.00155], N[Not[LessEqual[z, 3.2e-10]], $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 -0.00155 \lor \neg \left(z \leq 3.2 \cdot 10^{-10}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -0.00154999999999999995 or 3.19999999999999981e-10 < z Initial program 90.2%
Taylor expanded in z around inf 79.4%
unpow279.4%
associate-/r*85.1%
Simplified85.1%
if -0.00154999999999999995 < z < 3.19999999999999981e-10Initial program 94.2%
Taylor expanded in z around 0 68.2%
*-un-lft-identity68.2%
times-frac70.2%
Applied egg-rr70.2%
associate-*l/70.3%
*-lft-identity70.3%
Simplified70.3%
Final simplification77.5%
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 92.2%
associate-/l/97.2%
Simplified97.2%
Final simplification97.2%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* y t)))
assert(y < t);
double code(double x, double y, double z, double t) {
return x / (y * t);
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / (y * t)
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
return x / (y * t);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return x / (y * t)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(x / Float64(y * t)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = x / (y * t);
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\frac{x}{y \cdot t}
\end{array}
Initial program 92.2%
Taylor expanded in z around 0 46.1%
Final simplification46.1%
(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 2023221
(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))))