
(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 17 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 90.1%
associate-/l/96.5%
Simplified96.5%
Final simplification96.5%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- t z) (- y z))))
(if (<= t_1 (- INFINITY))
(/ (/ x (- t z)) y)
(if (<= t_1 5e+307) (/ x t_1) (/ (/ (- x) z) (- y z))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (t - z) * (y - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x / (t - z)) / y;
} else if (t_1 <= 5e+307) {
tmp = x / t_1;
} else {
tmp = (-x / z) / (y - z);
}
return tmp;
}
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (t - z) * (y - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (x / (t - z)) / y;
} else if (t_1 <= 5e+307) {
tmp = x / t_1;
} else {
tmp = (-x / z) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (t - z) * (y - z) tmp = 0 if t_1 <= -math.inf: tmp = (x / (t - z)) / y elif t_1 <= 5e+307: tmp = x / t_1 else: tmp = (-x / z) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(t - z) * Float64(y - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (t_1 <= 5e+307) tmp = Float64(x / t_1); else tmp = Float64(Float64(Float64(-x) / z) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (t - z) * (y - z);
tmp = 0.0;
if (t_1 <= -Inf)
tmp = (x / (t - z)) / y;
elseif (t_1 <= 5e+307)
tmp = x / t_1;
else
tmp = (-x / 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_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t$95$1, 5e+307], N[(x / t$95$1), $MachinePrecision], N[(N[((-x) / z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \left(t - z\right) \cdot \left(y - z\right)\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;\frac{x}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y - z}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -inf.0Initial program 79.8%
Taylor expanded in y around inf 69.4%
*-commutative69.4%
associate-/r*86.2%
Simplified86.2%
if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < 5e307Initial program 99.1%
if 5e307 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 74.3%
Taylor expanded in t around 0 71.5%
associate-*r/71.5%
neg-mul-171.5%
*-commutative71.5%
associate-/r*89.5%
Simplified89.5%
Final simplification95.0%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- t z) (- y z))))
(if (<= t_1 (- INFINITY))
(/ (/ x (- t z)) y)
(if (<= t_1 5e+307) (/ x t_1) (/ (* x (/ -1.0 z)) (- y z))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (t - z) * (y - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x / (t - z)) / y;
} else if (t_1 <= 5e+307) {
tmp = x / t_1;
} else {
tmp = (x * (-1.0 / z)) / (y - z);
}
return tmp;
}
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (t - z) * (y - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (x / (t - z)) / y;
} else if (t_1 <= 5e+307) {
tmp = x / t_1;
} else {
tmp = (x * (-1.0 / z)) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (t - z) * (y - z) tmp = 0 if t_1 <= -math.inf: tmp = (x / (t - z)) / y elif t_1 <= 5e+307: tmp = x / t_1 else: tmp = (x * (-1.0 / z)) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(t - z) * Float64(y - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (t_1 <= 5e+307) tmp = Float64(x / t_1); else tmp = Float64(Float64(x * Float64(-1.0 / z)) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (t - z) * (y - z);
tmp = 0.0;
if (t_1 <= -Inf)
tmp = (x / (t - z)) / y;
elseif (t_1 <= 5e+307)
tmp = x / t_1;
else
tmp = (x * (-1.0 / 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_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t$95$1, 5e+307], N[(x / t$95$1), $MachinePrecision], N[(N[(x * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \left(t - z\right) \cdot \left(y - z\right)\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;\frac{x}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{-1}{z}}{y - z}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -inf.0Initial program 79.8%
Taylor expanded in y around inf 69.4%
*-commutative69.4%
associate-/r*86.2%
Simplified86.2%
if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < 5e307Initial program 99.1%
if 5e307 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 74.3%
associate-/l/99.9%
Simplified99.9%
clear-num99.8%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 89.5%
Final simplification95.0%
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)) (t_2 (/ x (* (- t z) y))))
(if (<= z -5200000000.0)
t_1
(if (<= z -1.25e-135)
t_2
(if (<= z 1.9e-119)
(/ (/ x t) (- y z))
(if (<= z 1.75e-38)
t_2
(if (<= z 1.85e+74) (/ x (* t (- y z))) t_1)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double t_2 = x / ((t - z) * y);
double tmp;
if (z <= -5200000000.0) {
tmp = t_1;
} else if (z <= -1.25e-135) {
tmp = t_2;
} else if (z <= 1.9e-119) {
tmp = (x / t) / (y - z);
} else if (z <= 1.75e-38) {
tmp = t_2;
} else if (z <= 1.85e+74) {
tmp = x / (t * (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) :: t_2
real(8) :: tmp
t_1 = (x / z) / z
t_2 = x / ((t - z) * y)
if (z <= (-5200000000.0d0)) then
tmp = t_1
else if (z <= (-1.25d-135)) then
tmp = t_2
else if (z <= 1.9d-119) then
tmp = (x / t) / (y - z)
else if (z <= 1.75d-38) then
tmp = t_2
else if (z <= 1.85d+74) then
tmp = x / (t * (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 t_2 = x / ((t - z) * y);
double tmp;
if (z <= -5200000000.0) {
tmp = t_1;
} else if (z <= -1.25e-135) {
tmp = t_2;
} else if (z <= 1.9e-119) {
tmp = (x / t) / (y - z);
} else if (z <= 1.75e-38) {
tmp = t_2;
} else if (z <= 1.85e+74) {
tmp = x / (t * (y - z));
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z t_2 = x / ((t - z) * y) tmp = 0 if z <= -5200000000.0: tmp = t_1 elif z <= -1.25e-135: tmp = t_2 elif z <= 1.9e-119: tmp = (x / t) / (y - z) elif z <= 1.75e-38: tmp = t_2 elif z <= 1.85e+74: tmp = x / (t * (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) t_2 = Float64(x / Float64(Float64(t - z) * y)) tmp = 0.0 if (z <= -5200000000.0) tmp = t_1; elseif (z <= -1.25e-135) tmp = t_2; elseif (z <= 1.9e-119) tmp = Float64(Float64(x / t) / Float64(y - z)); elseif (z <= 1.75e-38) tmp = t_2; elseif (z <= 1.85e+74) tmp = Float64(x / Float64(t * Float64(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;
t_2 = x / ((t - z) * y);
tmp = 0.0;
if (z <= -5200000000.0)
tmp = t_1;
elseif (z <= -1.25e-135)
tmp = t_2;
elseif (z <= 1.9e-119)
tmp = (x / t) / (y - z);
elseif (z <= 1.75e-38)
tmp = t_2;
elseif (z <= 1.85e+74)
tmp = x / (t * (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]}, Block[{t$95$2 = N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5200000000.0], t$95$1, If[LessEqual[z, -1.25e-135], t$95$2, If[LessEqual[z, 1.9e-119], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e-38], t$95$2, If[LessEqual[z, 1.85e+74], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
t_2 := \frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{if}\;z \leq -5200000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-135}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-119}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-38}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+74}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.2e9 or 1.8500000000000001e74 < z Initial program 84.5%
Taylor expanded in z around inf 75.5%
unpow275.5%
associate-/r*83.9%
Simplified83.9%
if -5.2e9 < z < -1.25000000000000005e-135 or 1.89999999999999987e-119 < z < 1.7500000000000001e-38Initial program 97.7%
Taylor expanded in y around inf 58.1%
*-commutative58.1%
Simplified58.1%
if -1.25000000000000005e-135 < z < 1.89999999999999987e-119Initial program 91.5%
associate-/l/90.1%
Simplified90.1%
Taylor expanded in t around inf 81.5%
if 1.7500000000000001e-38 < z < 1.8500000000000001e74Initial program 99.7%
Taylor expanded in t around inf 49.2%
Final simplification75.5%
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 (- y z))))
(t_2 (/ (/ x z) z))
(t_3 (/ (/ x (- t z)) y)))
(if (<= z -5200000000.0)
t_2
(if (<= z -5e-291)
t_3
(if (<= z 1.05e-120)
t_1
(if (<= z 1.85e-41) t_3 (if (<= z 2.3e+70) t_1 t_2)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (t * (y - z));
double t_2 = (x / z) / z;
double t_3 = (x / (t - z)) / y;
double tmp;
if (z <= -5200000000.0) {
tmp = t_2;
} else if (z <= -5e-291) {
tmp = t_3;
} else if (z <= 1.05e-120) {
tmp = t_1;
} else if (z <= 1.85e-41) {
tmp = t_3;
} else if (z <= 2.3e+70) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x / (t * (y - z))
t_2 = (x / z) / z
t_3 = (x / (t - z)) / y
if (z <= (-5200000000.0d0)) then
tmp = t_2
else if (z <= (-5d-291)) then
tmp = t_3
else if (z <= 1.05d-120) then
tmp = t_1
else if (z <= 1.85d-41) then
tmp = t_3
else if (z <= 2.3d+70) then
tmp = t_1
else
tmp = t_2
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 * (y - z));
double t_2 = (x / z) / z;
double t_3 = (x / (t - z)) / y;
double tmp;
if (z <= -5200000000.0) {
tmp = t_2;
} else if (z <= -5e-291) {
tmp = t_3;
} else if (z <= 1.05e-120) {
tmp = t_1;
} else if (z <= 1.85e-41) {
tmp = t_3;
} else if (z <= 2.3e+70) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = x / (t * (y - z)) t_2 = (x / z) / z t_3 = (x / (t - z)) / y tmp = 0 if z <= -5200000000.0: tmp = t_2 elif z <= -5e-291: tmp = t_3 elif z <= 1.05e-120: tmp = t_1 elif z <= 1.85e-41: tmp = t_3 elif z <= 2.3e+70: tmp = t_1 else: tmp = t_2 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(t * Float64(y - z))) t_2 = Float64(Float64(x / z) / z) t_3 = Float64(Float64(x / Float64(t - z)) / y) tmp = 0.0 if (z <= -5200000000.0) tmp = t_2; elseif (z <= -5e-291) tmp = t_3; elseif (z <= 1.05e-120) tmp = t_1; elseif (z <= 1.85e-41) tmp = t_3; elseif (z <= 2.3e+70) tmp = t_1; else tmp = t_2; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = x / (t * (y - z));
t_2 = (x / z) / z;
t_3 = (x / (t - z)) / y;
tmp = 0.0;
if (z <= -5200000000.0)
tmp = t_2;
elseif (z <= -5e-291)
tmp = t_3;
elseif (z <= 1.05e-120)
tmp = t_1;
elseif (z <= 1.85e-41)
tmp = t_3;
elseif (z <= 2.3e+70)
tmp = t_1;
else
tmp = t_2;
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[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[z, -5200000000.0], t$95$2, If[LessEqual[z, -5e-291], t$95$3, If[LessEqual[z, 1.05e-120], t$95$1, If[LessEqual[z, 1.85e-41], t$95$3, If[LessEqual[z, 2.3e+70], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{t \cdot \left(y - z\right)}\\
t_2 := \frac{\frac{x}{z}}{z}\\
t_3 := \frac{\frac{x}{t - z}}{y}\\
\mathbf{if}\;z \leq -5200000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-291}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-120}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-41}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+70}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -5.2e9 or 2.29999999999999994e70 < z Initial program 84.5%
Taylor expanded in z around inf 75.5%
unpow275.5%
associate-/r*83.9%
Simplified83.9%
if -5.2e9 < z < -5.0000000000000003e-291 or 1.05e-120 < z < 1.8500000000000001e-41Initial program 90.8%
Taylor expanded in y around inf 65.4%
*-commutative65.4%
associate-/r*70.7%
Simplified70.7%
if -5.0000000000000003e-291 < z < 1.05e-120 or 1.8500000000000001e-41 < z < 2.29999999999999994e70Initial program 99.6%
Taylor expanded in t around inf 72.6%
Final simplification77.2%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y -3.4e-16)
(/ (/ x y) (- t z))
(if (<= y -9.2e-138)
(/ (/ x z) z)
(if (or (<= y -5.4e-304) (not (<= y 5.2e-181)))
(/ (/ 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 (y <= -3.4e-16) {
tmp = (x / y) / (t - z);
} else if (y <= -9.2e-138) {
tmp = (x / z) / z;
} else if ((y <= -5.4e-304) || !(y <= 5.2e-181)) {
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 (y <= (-3.4d-16)) then
tmp = (x / y) / (t - z)
else if (y <= (-9.2d-138)) then
tmp = (x / z) / z
else if ((y <= (-5.4d-304)) .or. (.not. (y <= 5.2d-181))) 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 (y <= -3.4e-16) {
tmp = (x / y) / (t - z);
} else if (y <= -9.2e-138) {
tmp = (x / z) / z;
} else if ((y <= -5.4e-304) || !(y <= 5.2e-181)) {
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 y <= -3.4e-16: tmp = (x / y) / (t - z) elif y <= -9.2e-138: tmp = (x / z) / z elif (y <= -5.4e-304) or not (y <= 5.2e-181): 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 (y <= -3.4e-16) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= -9.2e-138) tmp = Float64(Float64(x / z) / z); elseif ((y <= -5.4e-304) || !(y <= 5.2e-181)) 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 (y <= -3.4e-16)
tmp = (x / y) / (t - z);
elseif (y <= -9.2e-138)
tmp = (x / z) / z;
elseif ((y <= -5.4e-304) || ~((y <= 5.2e-181)))
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[y, -3.4e-16], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -9.2e-138], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[y, -5.4e-304], N[Not[LessEqual[y, 5.2e-181]], $MachinePrecision]], 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}\;y \leq -3.4 \cdot 10^{-16}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq -9.2 \cdot 10^{-138}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;y \leq -5.4 \cdot 10^{-304} \lor \neg \left(y \leq 5.2 \cdot 10^{-181}\right):\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{z}{\frac{x}{z}}}\\
\end{array}
\end{array}
if y < -3.4e-16Initial program 91.9%
associate-/r*97.1%
Simplified97.1%
Taylor expanded in y around inf 81.0%
if -3.4e-16 < y < -9.1999999999999996e-138Initial program 92.6%
Taylor expanded in z around inf 44.8%
unpow244.8%
associate-/r*51.9%
Simplified51.9%
if -9.1999999999999996e-138 < y < -5.40000000000000021e-304 or 5.19999999999999998e-181 < y Initial program 89.3%
associate-/l/95.8%
Simplified95.8%
Taylor expanded in t around inf 57.6%
if -5.40000000000000021e-304 < y < 5.19999999999999998e-181Initial program 86.7%
associate-/l/95.5%
Simplified95.5%
clear-num95.4%
associate-/r/95.6%
Applied egg-rr95.6%
clear-num95.5%
inv-pow95.5%
*-un-lft-identity95.5%
times-frac95.2%
clear-num95.1%
/-rgt-identity95.1%
Applied egg-rr95.1%
unpow-195.1%
Simplified95.1%
Taylor expanded in z around inf 51.2%
unpow251.2%
associate-/l*59.7%
Simplified59.7%
Final simplification63.5%
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 -2800000000.0)
t_1
(if (<= z 1e-81)
(/ (/ x t) y)
(if (<= z 4.2e-42)
(/ (/ (- x) y) z)
(if (<= z 3.8e+17) (/ (- x) (* t 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 <= -2800000000.0) {
tmp = t_1;
} else if (z <= 1e-81) {
tmp = (x / t) / y;
} else if (z <= 4.2e-42) {
tmp = (-x / y) / z;
} else if (z <= 3.8e+17) {
tmp = -x / (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 / z) / z
if (z <= (-2800000000.0d0)) then
tmp = t_1
else if (z <= 1d-81) then
tmp = (x / t) / y
else if (z <= 4.2d-42) then
tmp = (-x / y) / z
else if (z <= 3.8d+17) then
tmp = -x / (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 / z) / z;
double tmp;
if (z <= -2800000000.0) {
tmp = t_1;
} else if (z <= 1e-81) {
tmp = (x / t) / y;
} else if (z <= 4.2e-42) {
tmp = (-x / y) / z;
} else if (z <= 3.8e+17) {
tmp = -x / (t * 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 <= -2800000000.0: tmp = t_1 elif z <= 1e-81: tmp = (x / t) / y elif z <= 4.2e-42: tmp = (-x / y) / z elif z <= 3.8e+17: tmp = -x / (t * 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 <= -2800000000.0) tmp = t_1; elseif (z <= 1e-81) tmp = Float64(Float64(x / t) / y); elseif (z <= 4.2e-42) tmp = Float64(Float64(Float64(-x) / y) / z); elseif (z <= 3.8e+17) tmp = Float64(Float64(-x) / 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 / z) / z;
tmp = 0.0;
if (z <= -2800000000.0)
tmp = t_1;
elseif (z <= 1e-81)
tmp = (x / t) / y;
elseif (z <= 4.2e-42)
tmp = (-x / y) / z;
elseif (z <= 3.8e+17)
tmp = -x / (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[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -2800000000.0], t$95$1, If[LessEqual[z, 1e-81], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 4.2e-42], N[(N[((-x) / y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 3.8e+17], N[((-x) / N[(t * z), $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 -2800000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 10^{-81}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-42}:\\
\;\;\;\;\frac{\frac{-x}{y}}{z}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+17}:\\
\;\;\;\;\frac{-x}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.8e9 or 3.8e17 < z Initial program 85.6%
Taylor expanded in z around inf 72.3%
unpow272.3%
associate-/r*80.1%
Simplified80.1%
if -2.8e9 < z < 9.9999999999999996e-82Initial program 93.4%
Taylor expanded in z around 0 63.7%
div-inv63.7%
associate-/r*65.0%
Applied egg-rr65.0%
*-commutative65.0%
associate-*l/69.7%
associate-*r/65.5%
associate-*l/65.5%
*-lft-identity65.5%
Simplified65.5%
if 9.9999999999999996e-82 < z < 4.20000000000000013e-42Initial program 99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in y around inf 61.4%
Taylor expanded in t around 0 51.8%
associate-*r/51.8%
neg-mul-151.8%
Simplified51.8%
distribute-frac-neg51.8%
add-sqr-sqrt40.2%
sqrt-unprod43.5%
sqr-neg43.5%
sqrt-unprod11.0%
add-sqr-sqrt12.5%
associate-/r*12.5%
add-sqr-sqrt11.0%
sqrt-unprod43.6%
sqr-neg43.6%
sqrt-unprod40.4%
add-sqr-sqrt51.8%
Applied egg-rr51.8%
if 4.20000000000000013e-42 < z < 3.8e17Initial program 99.8%
Taylor expanded in t around inf 56.5%
Taylor expanded in y around 0 40.7%
associate-*r/40.7%
neg-mul-140.7%
*-commutative40.7%
Simplified40.7%
Final simplification71.0%
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 -760000000.0)
t_1
(if (<= z 4.7e-79)
(/ (/ x t) y)
(if (<= z 1.9e-39)
(/ (/ (- x) y) z)
(if (<= z 2.7e+15) (/ x (* t 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 <= -760000000.0) {
tmp = t_1;
} else if (z <= 4.7e-79) {
tmp = (x / t) / y;
} else if (z <= 1.9e-39) {
tmp = (-x / y) / z;
} else if (z <= 2.7e+15) {
tmp = x / (t * 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 <= (-760000000.0d0)) then
tmp = t_1
else if (z <= 4.7d-79) then
tmp = (x / t) / y
else if (z <= 1.9d-39) then
tmp = (-x / y) / z
else if (z <= 2.7d+15) then
tmp = x / (t * 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 <= -760000000.0) {
tmp = t_1;
} else if (z <= 4.7e-79) {
tmp = (x / t) / y;
} else if (z <= 1.9e-39) {
tmp = (-x / y) / z;
} else if (z <= 2.7e+15) {
tmp = x / (t * 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 <= -760000000.0: tmp = t_1 elif z <= 4.7e-79: tmp = (x / t) / y elif z <= 1.9e-39: tmp = (-x / y) / z elif z <= 2.7e+15: tmp = x / (t * 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 <= -760000000.0) tmp = t_1; elseif (z <= 4.7e-79) tmp = Float64(Float64(x / t) / y); elseif (z <= 1.9e-39) tmp = Float64(Float64(Float64(-x) / y) / z); elseif (z <= 2.7e+15) tmp = Float64(x / Float64(t * 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 <= -760000000.0)
tmp = t_1;
elseif (z <= 4.7e-79)
tmp = (x / t) / y;
elseif (z <= 1.9e-39)
tmp = (-x / y) / z;
elseif (z <= 2.7e+15)
tmp = x / (t * 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, -760000000.0], t$95$1, If[LessEqual[z, 4.7e-79], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1.9e-39], N[(N[((-x) / y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 2.7e+15], N[(x / N[(t * 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 -760000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-79}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{-x}{y}}{z}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+15}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -7.6e8 or 2.7e15 < z Initial program 85.6%
Taylor expanded in z around inf 72.3%
unpow272.3%
associate-/r*80.1%
Simplified80.1%
if -7.6e8 < z < 4.7000000000000002e-79Initial program 93.4%
Taylor expanded in z around 0 63.7%
div-inv63.7%
associate-/r*65.0%
Applied egg-rr65.0%
*-commutative65.0%
associate-*l/69.7%
associate-*r/65.5%
associate-*l/65.5%
*-lft-identity65.5%
Simplified65.5%
if 4.7000000000000002e-79 < z < 1.9000000000000001e-39Initial program 99.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in y around inf 61.4%
Taylor expanded in t around 0 51.8%
associate-*r/51.8%
neg-mul-151.8%
Simplified51.8%
distribute-frac-neg51.8%
add-sqr-sqrt40.2%
sqrt-unprod43.5%
sqr-neg43.5%
sqrt-unprod11.0%
add-sqr-sqrt12.5%
associate-/r*12.5%
add-sqr-sqrt11.0%
sqrt-unprod43.6%
sqr-neg43.6%
sqrt-unprod40.4%
add-sqr-sqrt51.8%
Applied egg-rr51.8%
if 1.9000000000000001e-39 < z < 2.7e15Initial program 99.8%
Taylor expanded in z around 0 33.9%
Final simplification70.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 -4600000000.0)
t_1
(if (<= z 8.6e-42)
(/ x (* (- t z) y))
(if (<= z 6.2e+66) (/ x (* t (- 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 <= -4600000000.0) {
tmp = t_1;
} else if (z <= 8.6e-42) {
tmp = x / ((t - z) * y);
} else if (z <= 6.2e+66) {
tmp = x / (t * (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 <= (-4600000000.0d0)) then
tmp = t_1
else if (z <= 8.6d-42) then
tmp = x / ((t - z) * y)
else if (z <= 6.2d+66) then
tmp = x / (t * (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 <= -4600000000.0) {
tmp = t_1;
} else if (z <= 8.6e-42) {
tmp = x / ((t - z) * y);
} else if (z <= 6.2e+66) {
tmp = x / (t * (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 <= -4600000000.0: tmp = t_1 elif z <= 8.6e-42: tmp = x / ((t - z) * y) elif z <= 6.2e+66: tmp = x / (t * (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 <= -4600000000.0) tmp = t_1; elseif (z <= 8.6e-42) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (z <= 6.2e+66) tmp = Float64(x / Float64(t * Float64(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 <= -4600000000.0)
tmp = t_1;
elseif (z <= 8.6e-42)
tmp = x / ((t - z) * y);
elseif (z <= 6.2e+66)
tmp = x / (t * (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, -4600000000.0], t$95$1, If[LessEqual[z, 8.6e-42], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+66], N[(x / N[(t * N[(y - z), $MachinePrecision]), $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 -4600000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-42}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+66}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.6e9 or 6.20000000000000037e66 < z Initial program 84.5%
Taylor expanded in z around inf 75.5%
unpow275.5%
associate-/r*83.9%
Simplified83.9%
if -4.6e9 < z < 8.6000000000000002e-42Initial program 94.0%
Taylor expanded in y around inf 74.3%
*-commutative74.3%
Simplified74.3%
if 8.6000000000000002e-42 < z < 6.20000000000000037e66Initial program 99.7%
Taylor expanded in t around inf 49.2%
Final simplification76.5%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.7e-16) (/ (/ x (- t z)) y) (if (<= y 6e-101) (/ (/ (- x) z) (- t z)) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e-16) {
tmp = (x / (t - z)) / y;
} else if (y <= 6e-101) {
tmp = (-x / z) / (t - 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 (y <= (-1.7d-16)) then
tmp = (x / (t - z)) / y
else if (y <= 6d-101) then
tmp = (-x / z) / (t - 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 (y <= -1.7e-16) {
tmp = (x / (t - z)) / y;
} else if (y <= 6e-101) {
tmp = (-x / z) / (t - z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -1.7e-16: tmp = (x / (t - z)) / y elif y <= 6e-101: tmp = (-x / z) / (t - z) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e-16) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (y <= 6e-101) tmp = Float64(Float64(Float64(-x) / z) / Float64(t - 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 (y <= -1.7e-16)
tmp = (x / (t - z)) / y;
elseif (y <= 6e-101)
tmp = (-x / z) / (t - 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[y, -1.7e-16], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 6e-101], N[(N[((-x) / z), $MachinePrecision] / N[(t - z), $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}\;y \leq -1.7 \cdot 10^{-16}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-101}:\\
\;\;\;\;\frac{\frac{-x}{z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.7e-16Initial program 91.9%
Taylor expanded in y around inf 79.4%
*-commutative79.4%
associate-/r*82.2%
Simplified82.2%
if -1.7e-16 < y < 6.0000000000000006e-101Initial program 92.0%
Taylor expanded in y around 0 76.2%
mul-1-neg76.2%
distribute-frac-neg76.2%
associate-/r*81.9%
Simplified81.9%
if 6.0000000000000006e-101 < y Initial program 87.0%
associate-/l/94.1%
Simplified94.1%
Taylor expanded in t around inf 57.6%
Final simplification72.9%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -2.5e-87) (/ (/ x y) (- t z)) (if (<= t 3.8e-35) (/ (/ (- x) z) (- y z)) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.5e-87) {
tmp = (x / y) / (t - z);
} else if (t <= 3.8e-35) {
tmp = (-x / z) / (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 <= (-2.5d-87)) then
tmp = (x / y) / (t - z)
else if (t <= 3.8d-35) then
tmp = (-x / z) / (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 <= -2.5e-87) {
tmp = (x / y) / (t - z);
} else if (t <= 3.8e-35) {
tmp = (-x / z) / (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 <= -2.5e-87: tmp = (x / y) / (t - z) elif t <= 3.8e-35: tmp = (-x / z) / (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 <= -2.5e-87) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 3.8e-35) tmp = Float64(Float64(Float64(-x) / z) / 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 <= -2.5e-87)
tmp = (x / y) / (t - z);
elseif (t <= 3.8e-35)
tmp = (-x / z) / (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, -2.5e-87], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e-35], N[(N[((-x) / z), $MachinePrecision] / N[(y - z), $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 -2.5 \cdot 10^{-87}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-35}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -2.50000000000000021e-87Initial program 87.5%
associate-/r*97.4%
Simplified97.4%
Taylor expanded in y around inf 58.7%
if -2.50000000000000021e-87 < t < 3.8000000000000001e-35Initial program 90.1%
Taylor expanded in t around 0 72.4%
associate-*r/72.4%
neg-mul-172.4%
*-commutative72.4%
associate-/r*79.5%
Simplified79.5%
if 3.8000000000000001e-35 < t Initial program 93.5%
associate-/l/98.3%
Simplified98.3%
Taylor expanded in t around inf 91.1%
Final simplification75.6%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -4.2e-88) (/ (/ x y) t) (if (<= t 4.2e-35) (/ (/ x z) z) (/ x (* t (- y z))))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.2e-88) {
tmp = (x / y) / t;
} else if (t <= 4.2e-35) {
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 (t <= (-4.2d-88)) then
tmp = (x / y) / t
else if (t <= 4.2d-35) 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 (t <= -4.2e-88) {
tmp = (x / y) / t;
} else if (t <= 4.2e-35) {
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 t <= -4.2e-88: tmp = (x / y) / t elif t <= 4.2e-35: 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 (t <= -4.2e-88) tmp = Float64(Float64(x / y) / t); elseif (t <= 4.2e-35) 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 (t <= -4.2e-88)
tmp = (x / y) / t;
elseif (t <= 4.2e-35)
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[LessEqual[t, -4.2e-88], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 4.2e-35], 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}\;t \leq -4.2 \cdot 10^{-88}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-35}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if t < -4.1999999999999999e-88Initial program 87.5%
Taylor expanded in z around 0 50.0%
clear-num49.1%
associate-/r/49.9%
associate-/r*50.3%
Applied egg-rr50.3%
associate-*l/52.2%
associate-*l/52.3%
*-un-lft-identity52.3%
Applied egg-rr52.3%
if -4.1999999999999999e-88 < t < 4.2e-35Initial program 90.1%
Taylor expanded in z around inf 49.1%
unpow249.1%
associate-/r*57.1%
Simplified57.1%
if 4.2e-35 < t Initial program 93.5%
Taylor expanded in t around inf 90.9%
Final simplification63.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 -1.6e+93) (not (<= z 3.05e+88))) (/ x (* z y)) (/ x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.6e+93) || !(z <= 3.05e+88)) {
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 <= (-1.6d+93)) .or. (.not. (z <= 3.05d+88))) 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 <= -1.6e+93) || !(z <= 3.05e+88)) {
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 <= -1.6e+93) or not (z <= 3.05e+88): 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 <= -1.6e+93) || !(z <= 3.05e+88)) 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 <= -1.6e+93) || ~((z <= 3.05e+88)))
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, -1.6e+93], N[Not[LessEqual[z, 3.05e+88]], $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 -1.6 \cdot 10^{+93} \lor \neg \left(z \leq 3.05 \cdot 10^{+88}\right):\\
\;\;\;\;\frac{x}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -1.6000000000000001e93 or 3.0499999999999999e88 < z Initial program 83.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in y around inf 50.2%
Taylor expanded in t around 0 49.1%
associate-*r/49.1%
neg-mul-149.1%
Simplified49.1%
expm1-log1p-u48.8%
expm1-udef66.0%
associate-/r*65.9%
add-sqr-sqrt22.6%
sqrt-unprod61.5%
sqr-neg61.5%
sqrt-unprod42.5%
add-sqr-sqrt65.1%
Applied egg-rr65.1%
expm1-def44.1%
expm1-log1p44.4%
associate-/r*48.1%
Simplified48.1%
if -1.6000000000000001e93 < z < 3.0499999999999999e88Initial program 93.8%
Taylor expanded in z around 0 49.7%
Final simplification49.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 -1800000000.0) (not (<= z 1.2e-81))) (/ x (* z z)) (/ x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1800000000.0) || !(z <= 1.2e-81)) {
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 <= (-1800000000.0d0)) .or. (.not. (z <= 1.2d-81))) 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 <= -1800000000.0) || !(z <= 1.2e-81)) {
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 <= -1800000000.0) or not (z <= 1.2e-81): 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 <= -1800000000.0) || !(z <= 1.2e-81)) 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 <= -1800000000.0) || ~((z <= 1.2e-81)))
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, -1800000000.0], N[Not[LessEqual[z, 1.2e-81]], $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 -1800000000 \lor \neg \left(z \leq 1.2 \cdot 10^{-81}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -1.8e9 or 1.2e-81 < z Initial program 87.8%
Taylor expanded in z around inf 65.1%
unpow265.1%
Simplified65.1%
if -1.8e9 < z < 1.2e-81Initial program 93.4%
Taylor expanded in z around 0 63.7%
Final simplification64.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 -4100000000.0) (not (<= z 2.05e-78))) (/ x (* z z)) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4100000000.0) || !(z <= 2.05e-78)) {
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 <= (-4100000000.0d0)) .or. (.not. (z <= 2.05d-78))) 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 <= -4100000000.0) || !(z <= 2.05e-78)) {
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 <= -4100000000.0) or not (z <= 2.05e-78): 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 <= -4100000000.0) || !(z <= 2.05e-78)) 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 <= -4100000000.0) || ~((z <= 2.05e-78)))
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, -4100000000.0], N[Not[LessEqual[z, 2.05e-78]], $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 -4100000000 \lor \neg \left(z \leq 2.05 \cdot 10^{-78}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -4.1e9 or 2.0499999999999999e-78 < z Initial program 87.8%
Taylor expanded in z around inf 65.1%
unpow265.1%
Simplified65.1%
if -4.1e9 < z < 2.0499999999999999e-78Initial program 93.4%
Taylor expanded in z around 0 63.7%
div-inv63.7%
associate-/r*65.0%
Applied egg-rr65.0%
*-commutative65.0%
associate-*l/69.7%
associate-*r/65.5%
associate-*l/65.5%
*-lft-identity65.5%
Simplified65.5%
Final simplification65.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 -4200000000.0) (not (<= z 2.05e-78))) (/ (/ x z) z) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4200000000.0) || !(z <= 2.05e-78)) {
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 <= (-4200000000.0d0)) .or. (.not. (z <= 2.05d-78))) 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 <= -4200000000.0) || !(z <= 2.05e-78)) {
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 <= -4200000000.0) or not (z <= 2.05e-78): 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 <= -4200000000.0) || !(z <= 2.05e-78)) 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 <= -4200000000.0) || ~((z <= 2.05e-78)))
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, -4200000000.0], N[Not[LessEqual[z, 2.05e-78]], $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 -4200000000 \lor \neg \left(z \leq 2.05 \cdot 10^{-78}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -4.2e9 or 2.0499999999999999e-78 < z Initial program 87.8%
Taylor expanded in z around inf 65.1%
unpow265.1%
associate-/r*71.7%
Simplified71.7%
if -4.2e9 < z < 2.0499999999999999e-78Initial program 93.4%
Taylor expanded in z around 0 63.7%
div-inv63.7%
associate-/r*65.0%
Applied egg-rr65.0%
*-commutative65.0%
associate-*l/69.7%
associate-*r/65.5%
associate-*l/65.5%
*-lft-identity65.5%
Simplified65.5%
Final simplification69.2%
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 90.1%
Taylor expanded in z around 0 42.7%
Final simplification42.7%
(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 2023171
(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))))