
(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: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ (/ x (- y z)) (- t z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - 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 / (y - z)) / (t - z)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - z);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (x / (y - z)) / (t - z)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(y - z)) / Float64(t - z)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (y - z)) / (t - 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[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{\frac{x}{y - z}}{t - z}
\end{array}
Initial program 89.5%
Taylor expanded in x around 0 89.5%
associate-/l/96.5%
Simplified96.5%
Final simplification96.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) (- t z))))
(if (<= t_1 (- INFINITY))
(/ (/ x (- t z)) y)
(if (<= t_1 1e+294) (/ x t_1) (/ (/ x z) (- z y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x / (t - z)) / y;
} else if (t_1 <= 1e+294) {
tmp = x / t_1;
} else {
tmp = (x / z) / (z - y);
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (x / (t - z)) / y;
} else if (t_1 <= 1e+294) {
tmp = x / t_1;
} else {
tmp = (x / z) / (z - y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if t_1 <= -math.inf: tmp = (x / (t - z)) / y elif t_1 <= 1e+294: tmp = x / t_1 else: tmp = (x / z) / (z - y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (t_1 <= 1e+294) tmp = Float64(x / t_1); 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)
t_1 = (y - z) * (t - z);
tmp = 0.0;
if (t_1 <= -Inf)
tmp = (x / (t - z)) / y;
elseif (t_1 <= 1e+294)
tmp = x / t_1;
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_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t$95$1, 1e+294], N[(x / t$95$1), $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}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;t\_1 \leq 10^{+294}:\\
\;\;\;\;\frac{x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -inf.0Initial program 66.3%
associate-/l/99.8%
div-inv99.7%
div-inv99.8%
associate-*l*70.0%
Applied egg-rr70.0%
*-commutative70.0%
associate-*r*99.8%
div-inv99.8%
clear-num99.8%
frac-times98.6%
metadata-eval98.6%
Applied egg-rr98.6%
Taylor expanded in y around inf 52.8%
*-commutative52.8%
associate-/r*81.9%
Simplified81.9%
if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < 1.00000000000000007e294Initial program 97.9%
if 1.00000000000000007e294 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 82.2%
Taylor expanded in x around 0 82.2%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around 0 80.4%
mul-1-neg80.4%
associate-/r*91.7%
distribute-neg-frac291.7%
Simplified91.7%
Final simplification94.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 -1.02e+37)
(/ (/ x z) (- t))
(if (<= z 1.45e-126)
(/ 1.0 (* t (/ y x)))
(if (or (<= z 1.45e+117) (not (<= z 1.2e+219)))
(/ x (* y (- z)))
(* (/ x z) (/ -1.0 t))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.02e+37) {
tmp = (x / z) / -t;
} else if (z <= 1.45e-126) {
tmp = 1.0 / (t * (y / x));
} else if ((z <= 1.45e+117) || !(z <= 1.2e+219)) {
tmp = x / (y * -z);
} else {
tmp = (x / z) * (-1.0 / 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.02d+37)) then
tmp = (x / z) / -t
else if (z <= 1.45d-126) then
tmp = 1.0d0 / (t * (y / x))
else if ((z <= 1.45d+117) .or. (.not. (z <= 1.2d+219))) then
tmp = x / (y * -z)
else
tmp = (x / z) * ((-1.0d0) / 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.02e+37) {
tmp = (x / z) / -t;
} else if (z <= 1.45e-126) {
tmp = 1.0 / (t * (y / x));
} else if ((z <= 1.45e+117) || !(z <= 1.2e+219)) {
tmp = x / (y * -z);
} else {
tmp = (x / z) * (-1.0 / t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -1.02e+37: tmp = (x / z) / -t elif z <= 1.45e-126: tmp = 1.0 / (t * (y / x)) elif (z <= 1.45e+117) or not (z <= 1.2e+219): tmp = x / (y * -z) else: tmp = (x / z) * (-1.0 / t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.02e+37) tmp = Float64(Float64(x / z) / Float64(-t)); elseif (z <= 1.45e-126) tmp = Float64(1.0 / Float64(t * Float64(y / x))); elseif ((z <= 1.45e+117) || !(z <= 1.2e+219)) tmp = Float64(x / Float64(y * Float64(-z))); else tmp = Float64(Float64(x / z) * Float64(-1.0 / 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.02e+37)
tmp = (x / z) / -t;
elseif (z <= 1.45e-126)
tmp = 1.0 / (t * (y / x));
elseif ((z <= 1.45e+117) || ~((z <= 1.2e+219)))
tmp = x / (y * -z);
else
tmp = (x / z) * (-1.0 / 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[LessEqual[z, -1.02e+37], N[(N[(x / z), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[z, 1.45e-126], N[(1.0 / N[(t * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.45e+117], N[Not[LessEqual[z, 1.2e+219]], $MachinePrecision]], N[(x / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(-1.0 / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+37}:\\
\;\;\;\;\frac{\frac{x}{z}}{-t}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-126}:\\
\;\;\;\;\frac{1}{t \cdot \frac{y}{x}}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+117} \lor \neg \left(z \leq 1.2 \cdot 10^{+219}\right):\\
\;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-1}{t}\\
\end{array}
\end{array}
if z < -1.01999999999999995e37Initial program 89.0%
Taylor expanded in y around 0 78.2%
mul-1-neg78.2%
distribute-neg-frac278.2%
distribute-rgt-neg-in78.2%
neg-sub078.2%
associate--r-78.2%
neg-sub078.2%
mul-1-neg78.2%
+-commutative78.2%
mul-1-neg78.2%
unsub-neg78.2%
Simplified78.2%
Taylor expanded in z around 0 41.5%
associate-*r/41.5%
mul-1-neg41.5%
Simplified41.5%
Taylor expanded in x around 0 41.5%
associate-*r/41.5%
times-frac49.0%
associate-*l/49.0%
associate-*r/49.0%
neg-mul-149.0%
Simplified49.0%
if -1.01999999999999995e37 < z < 1.44999999999999994e-126Initial program 91.1%
Taylor expanded in z around 0 61.4%
clear-num60.7%
inv-pow60.7%
associate-/l*67.2%
Applied egg-rr67.2%
unpow-167.2%
Simplified67.2%
if 1.44999999999999994e-126 < z < 1.45000000000000014e117 or 1.2e219 < z Initial program 93.8%
Taylor expanded in t around 0 85.6%
associate-*r/85.6%
neg-mul-185.6%
Simplified85.6%
Taylor expanded in z around 0 43.1%
associate-*r/43.1%
mul-1-neg43.1%
*-commutative43.1%
Simplified43.1%
if 1.45000000000000014e117 < z < 1.2e219Initial program 72.0%
Taylor expanded in y around 0 68.3%
mul-1-neg68.3%
distribute-neg-frac268.3%
distribute-rgt-neg-in68.3%
neg-sub068.3%
associate--r-68.3%
neg-sub068.3%
mul-1-neg68.3%
+-commutative68.3%
mul-1-neg68.3%
unsub-neg68.3%
Simplified68.3%
associate-/r*85.8%
div-inv85.7%
Applied egg-rr85.7%
Taylor expanded in z around 0 32.3%
Final simplification52.5%
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 -37000000000.0)
t_1
(if (<= z 7.2e-127)
(/ x (* (- y z) t))
(if (or (<= z 1.25e+27) (not (<= z 3.5e+52))) t_1 (/ x (* y (- z))))))))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 <= -37000000000.0) {
tmp = t_1;
} else if (z <= 7.2e-127) {
tmp = x / ((y - z) * t);
} else if ((z <= 1.25e+27) || !(z <= 3.5e+52)) {
tmp = t_1;
} else {
tmp = x / (y * -z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (z * (z - t))
if (z <= (-37000000000.0d0)) then
tmp = t_1
else if (z <= 7.2d-127) then
tmp = x / ((y - z) * t)
else if ((z <= 1.25d+27) .or. (.not. (z <= 3.5d+52))) then
tmp = t_1
else
tmp = x / (y * -z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - t));
double tmp;
if (z <= -37000000000.0) {
tmp = t_1;
} else if (z <= 7.2e-127) {
tmp = x / ((y - z) * t);
} else if ((z <= 1.25e+27) || !(z <= 3.5e+52)) {
tmp = t_1;
} else {
tmp = x / (y * -z);
}
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 <= -37000000000.0: tmp = t_1 elif z <= 7.2e-127: tmp = x / ((y - z) * t) elif (z <= 1.25e+27) or not (z <= 3.5e+52): tmp = t_1 else: tmp = x / (y * -z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(z * Float64(z - t))) tmp = 0.0 if (z <= -37000000000.0) tmp = t_1; elseif (z <= 7.2e-127) tmp = Float64(x / Float64(Float64(y - z) * t)); elseif ((z <= 1.25e+27) || !(z <= 3.5e+52)) tmp = t_1; else tmp = Float64(x / Float64(y * Float64(-z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = x / (z * (z - t));
tmp = 0.0;
if (z <= -37000000000.0)
tmp = t_1;
elseif (z <= 7.2e-127)
tmp = x / ((y - z) * t);
elseif ((z <= 1.25e+27) || ~((z <= 3.5e+52)))
tmp = t_1;
else
tmp = x / (y * -z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -37000000000.0], t$95$1, If[LessEqual[z, 7.2e-127], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.25e+27], N[Not[LessEqual[z, 3.5e+52]], $MachinePrecision]], t$95$1, N[(x / N[(y * (-z)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{if}\;z \leq -37000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-127}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+27} \lor \neg \left(z \leq 3.5 \cdot 10^{+52}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\
\end{array}
\end{array}
if z < -3.7e10 or 7.1999999999999999e-127 < z < 1.24999999999999995e27 or 3.5e52 < z Initial program 88.4%
Taylor expanded in y around 0 74.0%
mul-1-neg74.0%
distribute-neg-frac274.0%
distribute-rgt-neg-in74.0%
neg-sub074.0%
associate--r-74.0%
neg-sub074.0%
mul-1-neg74.0%
+-commutative74.0%
mul-1-neg74.0%
unsub-neg74.0%
Simplified74.0%
if -3.7e10 < z < 7.1999999999999999e-127Initial program 90.6%
Taylor expanded in t around inf 68.1%
if 1.24999999999999995e27 < z < 3.5e52Initial program 100.0%
Taylor expanded in t around 0 59.8%
associate-*r/59.8%
neg-mul-159.8%
Simplified59.8%
Taylor expanded in z around 0 58.8%
associate-*r/58.8%
mul-1-neg58.8%
*-commutative58.8%
Simplified58.8%
Final simplification71.5%
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 (* y t))))
(if (<= t -1.9e-11)
t_1
(if (<= t 1.15e-54)
(/ x (* y (- z)))
(if (<= t 2.9e+63) t_1 (/ x (* z (- t))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (y * t);
double tmp;
if (t <= -1.9e-11) {
tmp = t_1;
} else if (t <= 1.15e-54) {
tmp = x / (y * -z);
} else if (t <= 2.9e+63) {
tmp = t_1;
} else {
tmp = x / (z * -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) :: t_1
real(8) :: tmp
t_1 = x / (y * t)
if (t <= (-1.9d-11)) then
tmp = t_1
else if (t <= 1.15d-54) then
tmp = x / (y * -z)
else if (t <= 2.9d+63) then
tmp = t_1
else
tmp = x / (z * -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 t_1 = x / (y * t);
double tmp;
if (t <= -1.9e-11) {
tmp = t_1;
} else if (t <= 1.15e-54) {
tmp = x / (y * -z);
} else if (t <= 2.9e+63) {
tmp = t_1;
} else {
tmp = x / (z * -t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x / (y * t) tmp = 0 if t <= -1.9e-11: tmp = t_1 elif t <= 1.15e-54: tmp = x / (y * -z) elif t <= 2.9e+63: tmp = t_1 else: tmp = x / (z * -t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(y * t)) tmp = 0.0 if (t <= -1.9e-11) tmp = t_1; elseif (t <= 1.15e-54) tmp = Float64(x / Float64(y * Float64(-z))); elseif (t <= 2.9e+63) tmp = t_1; else tmp = Float64(x / Float64(z * Float64(-t))); 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 / (y * t);
tmp = 0.0;
if (t <= -1.9e-11)
tmp = t_1;
elseif (t <= 1.15e-54)
tmp = x / (y * -z);
elseif (t <= 2.9e+63)
tmp = t_1;
else
tmp = x / (z * -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_] := Block[{t$95$1 = N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.9e-11], t$95$1, If[LessEqual[t, 1.15e-54], N[(x / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e+63], t$95$1, N[(x / N[(z * (-t)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{y \cdot t}\\
\mathbf{if}\;t \leq -1.9 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-54}:\\
\;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\
\end{array}
\end{array}
if t < -1.8999999999999999e-11 or 1.1499999999999999e-54 < t < 2.8999999999999999e63Initial program 87.5%
Taylor expanded in z around 0 53.7%
if -1.8999999999999999e-11 < t < 1.1499999999999999e-54Initial program 91.6%
Taylor expanded in t around 0 79.8%
associate-*r/79.8%
neg-mul-179.8%
Simplified79.8%
Taylor expanded in z around 0 46.2%
associate-*r/46.2%
mul-1-neg46.2%
*-commutative46.2%
Simplified46.2%
if 2.8999999999999999e63 < t Initial program 87.3%
Taylor expanded in y around 0 61.9%
mul-1-neg61.9%
distribute-neg-frac261.9%
distribute-rgt-neg-in61.9%
neg-sub061.9%
associate--r-61.9%
neg-sub061.9%
mul-1-neg61.9%
+-commutative61.9%
mul-1-neg61.9%
unsub-neg61.9%
Simplified61.9%
Taylor expanded in z around 0 59.4%
associate-*r/59.4%
mul-1-neg59.4%
Simplified59.4%
Final simplification50.9%
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 (* y t))))
(if (<= t -1.8e-11)
t_1
(if (<= t 4.4e-55)
(/ x (* y (- z)))
(if (<= t 6.2e+63) t_1 (/ (/ x (- t)) z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (y * t);
double tmp;
if (t <= -1.8e-11) {
tmp = t_1;
} else if (t <= 4.4e-55) {
tmp = x / (y * -z);
} else if (t <= 6.2e+63) {
tmp = t_1;
} else {
tmp = (x / -t) / z;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (y * t)
if (t <= (-1.8d-11)) then
tmp = t_1
else if (t <= 4.4d-55) then
tmp = x / (y * -z)
else if (t <= 6.2d+63) then
tmp = t_1
else
tmp = (x / -t) / z
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = x / (y * t);
double tmp;
if (t <= -1.8e-11) {
tmp = t_1;
} else if (t <= 4.4e-55) {
tmp = x / (y * -z);
} else if (t <= 6.2e+63) {
tmp = t_1;
} else {
tmp = (x / -t) / z;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x / (y * t) tmp = 0 if t <= -1.8e-11: tmp = t_1 elif t <= 4.4e-55: tmp = x / (y * -z) elif t <= 6.2e+63: tmp = t_1 else: tmp = (x / -t) / z return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(y * t)) tmp = 0.0 if (t <= -1.8e-11) tmp = t_1; elseif (t <= 4.4e-55) tmp = Float64(x / Float64(y * Float64(-z))); elseif (t <= 6.2e+63) tmp = t_1; else tmp = Float64(Float64(x / Float64(-t)) / z); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = x / (y * t);
tmp = 0.0;
if (t <= -1.8e-11)
tmp = t_1;
elseif (t <= 4.4e-55)
tmp = x / (y * -z);
elseif (t <= 6.2e+63)
tmp = t_1;
else
tmp = (x / -t) / z;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.8e-11], t$95$1, If[LessEqual[t, 4.4e-55], N[(x / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e+63], t$95$1, N[(N[(x / (-t)), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{y \cdot t}\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{-t}}{z}\\
\end{array}
\end{array}
if t < -1.79999999999999992e-11 or 4.3999999999999999e-55 < t < 6.2000000000000001e63Initial program 87.5%
Taylor expanded in z around 0 53.7%
if -1.79999999999999992e-11 < t < 4.3999999999999999e-55Initial program 91.6%
Taylor expanded in t around 0 79.8%
associate-*r/79.8%
neg-mul-179.8%
Simplified79.8%
Taylor expanded in z around 0 46.2%
associate-*r/46.2%
mul-1-neg46.2%
*-commutative46.2%
Simplified46.2%
if 6.2000000000000001e63 < t Initial program 87.3%
Taylor expanded in y around 0 61.9%
mul-1-neg61.9%
distribute-neg-frac261.9%
distribute-rgt-neg-in61.9%
neg-sub061.9%
associate--r-61.9%
neg-sub061.9%
mul-1-neg61.9%
+-commutative61.9%
mul-1-neg61.9%
unsub-neg61.9%
Simplified61.9%
associate-/r*66.9%
div-inv67.0%
Applied egg-rr67.0%
Taylor expanded in z around 0 54.9%
associate-*l/64.3%
frac-2neg64.3%
metadata-eval64.3%
un-div-inv64.3%
Applied egg-rr64.3%
Final simplification51.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.4e+115) (not (<= z 1.6e+63))) (/ x (* z (- y z))) (/ x (* (- y z) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.4e+115) || !(z <= 1.6e+63)) {
tmp = x / (z * (y - z));
} else {
tmp = x / ((y - z) * 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.4d+115)) .or. (.not. (z <= 1.6d+63))) then
tmp = x / (z * (y - z))
else
tmp = x / ((y - z) * 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.4e+115) || !(z <= 1.6e+63)) {
tmp = x / (z * (y - z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.4e+115) or not (z <= 1.6e+63): tmp = x / (z * (y - z)) else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -1.4e+115) || !(z <= 1.6e+63)) tmp = Float64(x / Float64(z * Float64(y - z))); else tmp = Float64(x / Float64(Float64(y - z) * 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.4e+115) || ~((z <= 1.6e+63)))
tmp = x / (z * (y - z));
else
tmp = x / ((y - z) * 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.4e+115], N[Not[LessEqual[z, 1.6e+63]], $MachinePrecision]], N[(x / N[(z * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+115} \lor \neg \left(z \leq 1.6 \cdot 10^{+63}\right):\\
\;\;\;\;\frac{x}{z \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if z < -1.4e115 or 1.60000000000000006e63 < z Initial program 83.4%
Taylor expanded in t around 0 83.2%
associate-*r/83.2%
neg-mul-183.2%
Simplified83.2%
div-inv83.1%
add-sqr-sqrt37.3%
sqrt-unprod67.2%
sqr-neg67.2%
sqrt-unprod35.0%
add-sqr-sqrt70.4%
*-commutative70.4%
associate-/r*70.4%
Applied egg-rr70.4%
associate-*r/69.3%
associate-*l/69.3%
associate-*r/69.3%
associate-*l/69.3%
*-rgt-identity69.3%
associate-/r*70.4%
Simplified70.4%
if -1.4e115 < z < 1.60000000000000006e63Initial program 93.6%
Taylor expanded in t around inf 57.3%
Final simplification62.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -1.15e-114) (/ 1.0 (* t (/ y x))) (if (<= t 7.6e-55) (/ x (* y (- z))) (/ x (* (- y z) t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.15e-114) {
tmp = 1.0 / (t * (y / x));
} else if (t <= 7.6e-55) {
tmp = x / (y * -z);
} else {
tmp = x / ((y - z) * 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 (t <= (-1.15d-114)) then
tmp = 1.0d0 / (t * (y / x))
else if (t <= 7.6d-55) then
tmp = x / (y * -z)
else
tmp = x / ((y - z) * 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 (t <= -1.15e-114) {
tmp = 1.0 / (t * (y / x));
} else if (t <= 7.6e-55) {
tmp = x / (y * -z);
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -1.15e-114: tmp = 1.0 / (t * (y / x)) elif t <= 7.6e-55: tmp = x / (y * -z) else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -1.15e-114) tmp = Float64(1.0 / Float64(t * Float64(y / x))); elseif (t <= 7.6e-55) tmp = Float64(x / Float64(y * Float64(-z))); else tmp = Float64(x / Float64(Float64(y - z) * 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 (t <= -1.15e-114)
tmp = 1.0 / (t * (y / x));
elseif (t <= 7.6e-55)
tmp = x / (y * -z);
else
tmp = x / ((y - z) * 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[LessEqual[t, -1.15e-114], N[(1.0 / N[(t * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.6e-55], N[(x / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{-114}:\\
\;\;\;\;\frac{1}{t \cdot \frac{y}{x}}\\
\mathbf{elif}\;t \leq 7.6 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -1.15e-114Initial program 84.3%
Taylor expanded in z around 0 42.7%
clear-num42.0%
inv-pow42.0%
associate-/l*47.3%
Applied egg-rr47.3%
unpow-147.3%
Simplified47.3%
if -1.15e-114 < t < 7.5999999999999993e-55Initial program 94.1%
Taylor expanded in t around 0 84.4%
associate-*r/84.4%
neg-mul-184.4%
Simplified84.4%
Taylor expanded in z around 0 48.4%
associate-*r/48.4%
mul-1-neg48.4%
*-commutative48.4%
Simplified48.4%
if 7.5999999999999993e-55 < t Initial program 89.2%
Taylor expanded in t around inf 78.9%
Final simplification55.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 (<= y -6.5e+29) (/ x (* y (- t z))) (if (<= y 1.02e-157) (/ x (* z (- z t))) (/ x (* (- y z) t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.5e+29) {
tmp = x / (y * (t - z));
} else if (y <= 1.02e-157) {
tmp = x / (z * (z - t));
} else {
tmp = x / ((y - z) * 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 (y <= (-6.5d+29)) then
tmp = x / (y * (t - z))
else if (y <= 1.02d-157) then
tmp = x / (z * (z - t))
else
tmp = x / ((y - z) * 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 (y <= -6.5e+29) {
tmp = x / (y * (t - z));
} else if (y <= 1.02e-157) {
tmp = x / (z * (z - t));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -6.5e+29: tmp = x / (y * (t - z)) elif y <= 1.02e-157: tmp = x / (z * (z - t)) else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -6.5e+29) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 1.02e-157) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(x / Float64(Float64(y - z) * 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 (y <= -6.5e+29)
tmp = x / (y * (t - z));
elseif (y <= 1.02e-157)
tmp = x / (z * (z - t));
else
tmp = x / ((y - z) * 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[LessEqual[y, -6.5e+29], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e-157], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+29}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{-157}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -6.49999999999999971e29Initial program 88.8%
Taylor expanded in y around inf 85.7%
*-commutative85.7%
Simplified85.7%
if -6.49999999999999971e29 < y < 1.0200000000000001e-157Initial program 92.6%
Taylor expanded in y around 0 78.3%
mul-1-neg78.3%
distribute-neg-frac278.3%
distribute-rgt-neg-in78.3%
neg-sub078.3%
associate--r-78.3%
neg-sub078.3%
mul-1-neg78.3%
+-commutative78.3%
mul-1-neg78.3%
unsub-neg78.3%
Simplified78.3%
if 1.0200000000000001e-157 < y Initial program 86.4%
Taylor expanded in t around inf 45.0%
Final simplification69.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 (<= y -6.5e+57) (/ (/ x y) (- t z)) (if (<= y 1.9e-157) (/ x (* z (- z t))) (/ x (* (- y z) t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.5e+57) {
tmp = (x / y) / (t - z);
} else if (y <= 1.9e-157) {
tmp = x / (z * (z - t));
} else {
tmp = x / ((y - z) * 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 (y <= (-6.5d+57)) then
tmp = (x / y) / (t - z)
else if (y <= 1.9d-157) then
tmp = x / (z * (z - t))
else
tmp = x / ((y - z) * 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 (y <= -6.5e+57) {
tmp = (x / y) / (t - z);
} else if (y <= 1.9e-157) {
tmp = x / (z * (z - t));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -6.5e+57: tmp = (x / y) / (t - z) elif y <= 1.9e-157: tmp = x / (z * (z - t)) else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -6.5e+57) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 1.9e-157) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(x / Float64(Float64(y - z) * 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 (y <= -6.5e+57)
tmp = (x / y) / (t - z);
elseif (y <= 1.9e-157)
tmp = x / (z * (z - t));
else
tmp = x / ((y - z) * 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[LessEqual[y, -6.5e+57], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-157], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+57}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-157}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -6.4999999999999997e57Initial program 87.7%
Taylor expanded in x around 0 87.7%
associate-/l/96.9%
Simplified96.9%
Taylor expanded in y around inf 87.8%
if -6.4999999999999997e57 < y < 1.9000000000000001e-157Initial program 93.0%
Taylor expanded in y around 0 76.5%
mul-1-neg76.5%
distribute-neg-frac276.5%
distribute-rgt-neg-in76.5%
neg-sub076.5%
associate--r-76.5%
neg-sub076.5%
mul-1-neg76.5%
+-commutative76.5%
mul-1-neg76.5%
unsub-neg76.5%
Simplified76.5%
if 1.9000000000000001e-157 < y Initial program 86.4%
Taylor expanded in t around inf 45.0%
Final simplification69.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 -1e+58) (/ (/ x y) (- t z)) (if (<= y 2.35e-157) (/ (/ x (- z t)) z) (/ x (* (- y z) t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1e+58) {
tmp = (x / y) / (t - z);
} else if (y <= 2.35e-157) {
tmp = (x / (z - t)) / z;
} else {
tmp = x / ((y - z) * 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 (y <= (-1d+58)) then
tmp = (x / y) / (t - z)
else if (y <= 2.35d-157) then
tmp = (x / (z - t)) / z
else
tmp = x / ((y - z) * 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 (y <= -1e+58) {
tmp = (x / y) / (t - z);
} else if (y <= 2.35e-157) {
tmp = (x / (z - t)) / z;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -1e+58: tmp = (x / y) / (t - z) elif y <= 2.35e-157: tmp = (x / (z - t)) / z else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1e+58) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 2.35e-157) tmp = Float64(Float64(x / Float64(z - t)) / z); else tmp = Float64(x / Float64(Float64(y - z) * 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 (y <= -1e+58)
tmp = (x / y) / (t - z);
elseif (y <= 2.35e-157)
tmp = (x / (z - t)) / z;
else
tmp = x / ((y - z) * 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[LessEqual[y, -1e+58], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.35e-157], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+58}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 2.35 \cdot 10^{-157}:\\
\;\;\;\;\frac{\frac{x}{z - t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -9.99999999999999944e57Initial program 87.7%
Taylor expanded in x around 0 87.7%
associate-/l/96.9%
Simplified96.9%
Taylor expanded in y around inf 87.8%
if -9.99999999999999944e57 < y < 2.3500000000000001e-157Initial program 93.0%
Taylor expanded in y around 0 76.5%
mul-1-neg76.5%
distribute-neg-frac276.5%
distribute-rgt-neg-in76.5%
neg-sub076.5%
associate--r-76.5%
neg-sub076.5%
mul-1-neg76.5%
+-commutative76.5%
mul-1-neg76.5%
unsub-neg76.5%
Simplified76.5%
associate-/r*80.7%
div-inv80.7%
Applied egg-rr80.7%
associate-*l/85.0%
un-div-inv85.1%
Applied egg-rr85.1%
if 2.3500000000000001e-157 < y Initial program 86.4%
Taylor expanded in t around inf 45.0%
Final simplification72.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 (<= y -7.2e-5) (not (<= y 3.2e-150))) (/ x (* y t)) (/ x (* z (- t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.2e-5) || !(y <= 3.2e-150)) {
tmp = x / (y * t);
} else {
tmp = x / (z * -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 ((y <= (-7.2d-5)) .or. (.not. (y <= 3.2d-150))) then
tmp = x / (y * t)
else
tmp = x / (z * -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 ((y <= -7.2e-5) || !(y <= 3.2e-150)) {
tmp = x / (y * t);
} else {
tmp = x / (z * -t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -7.2e-5) or not (y <= 3.2e-150): tmp = x / (y * t) else: tmp = x / (z * -t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -7.2e-5) || !(y <= 3.2e-150)) tmp = Float64(x / Float64(y * t)); else tmp = Float64(x / Float64(z * Float64(-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 ((y <= -7.2e-5) || ~((y <= 3.2e-150)))
tmp = x / (y * t);
else
tmp = x / (z * -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[y, -7.2e-5], N[Not[LessEqual[y, 3.2e-150]], $MachinePrecision]], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision], N[(x / N[(z * (-t)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-5} \lor \neg \left(y \leq 3.2 \cdot 10^{-150}\right):\\
\;\;\;\;\frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\
\end{array}
\end{array}
if y < -7.20000000000000018e-5 or 3.1999999999999998e-150 < y Initial program 88.2%
Taylor expanded in z around 0 42.9%
if -7.20000000000000018e-5 < y < 3.1999999999999998e-150Initial program 91.8%
Taylor expanded in y around 0 78.2%
mul-1-neg78.2%
distribute-neg-frac278.2%
distribute-rgt-neg-in78.2%
neg-sub078.2%
associate--r-78.2%
neg-sub078.2%
mul-1-neg78.2%
+-commutative78.2%
mul-1-neg78.2%
unsub-neg78.2%
Simplified78.2%
Taylor expanded in z around 0 37.5%
associate-*r/37.5%
mul-1-neg37.5%
Simplified37.5%
Final simplification40.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 (or (<= z -3.6e-36) (not (<= z 1.05e+102))) (/ x (* z t)) (/ x (* y t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.6e-36) || !(z <= 1.05e+102)) {
tmp = x / (z * t);
} 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 <= (-3.6d-36)) .or. (.not. (z <= 1.05d+102))) then
tmp = x / (z * t)
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 <= -3.6e-36) || !(z <= 1.05e+102)) {
tmp = x / (z * t);
} 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 <= -3.6e-36) or not (z <= 1.05e+102): tmp = x / (z * t) 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 <= -3.6e-36) || !(z <= 1.05e+102)) tmp = Float64(x / Float64(z * t)); else tmp = Float64(x / Float64(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 <= -3.6e-36) || ~((z <= 1.05e+102)))
tmp = x / (z * t);
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, -3.6e-36], N[Not[LessEqual[z, 1.05e+102]], $MachinePrecision]], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-36} \lor \neg \left(z \leq 1.05 \cdot 10^{+102}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -3.60000000000000032e-36 or 1.05000000000000001e102 < z Initial program 86.9%
Taylor expanded in y around 0 75.2%
mul-1-neg75.2%
distribute-neg-frac275.2%
distribute-rgt-neg-in75.2%
neg-sub075.2%
associate--r-75.2%
neg-sub075.2%
mul-1-neg75.2%
+-commutative75.2%
mul-1-neg75.2%
unsub-neg75.2%
Simplified75.2%
Taylor expanded in z around 0 37.0%
associate-*r/37.0%
mul-1-neg37.0%
Simplified37.0%
div-inv37.0%
add-sqr-sqrt20.5%
sqrt-unprod42.2%
sqr-neg42.2%
sqrt-unprod14.3%
add-sqr-sqrt34.1%
*-commutative34.1%
Applied egg-rr34.1%
associate-*r/34.1%
*-rgt-identity34.1%
Simplified34.1%
if -3.60000000000000032e-36 < z < 1.05000000000000001e102Initial program 91.9%
Taylor expanded in z around 0 50.5%
Final simplification42.6%
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 89.5%
associate-/l/97.9%
Simplified97.9%
Final simplification97.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* y t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return x / (y * t);
}
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 / (y * t)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return x / (y * t);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x / (y * t)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x / Float64(y * t)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = x / (y * t);
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[(y * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{y \cdot t}
\end{array}
Initial program 89.5%
Taylor expanded in z around 0 35.0%
Final simplification35.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 2024066
(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))))