
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
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 = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
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 = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\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 (+ 1.0 (* (/ 1.0 (- y z)) (/ x (- t y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + ((1.0 / (y - z)) * (x / (t - y)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + ((1.0d0 / (y - z)) * (x / (t - y)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + ((1.0 / (y - z)) * (x / (t - y)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + ((1.0 / (y - z)) * (x / (t - y)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(Float64(1.0 / Float64(y - z)) * Float64(x / Float64(t - y)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + ((1.0 / (y - z)) * (x / (t - y)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[(1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(x / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{1}{y - z} \cdot \frac{x}{t - y}
\end{array}
Initial program 98.4%
*-un-lft-identity98.4%
times-frac97.7%
Applied egg-rr97.7%
Final simplification97.7%
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 -2400.0)
(- 1.0 (/ (/ x z) t))
(if (or (<= z -4.7e-73) (and (not (<= z -1.6e-124)) (<= z 2.6e-135)))
(+ 1.0 (/ x (* y t)))
(- 1.0 (/ (/ x t) z)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2400.0) {
tmp = 1.0 - ((x / z) / t);
} else if ((z <= -4.7e-73) || (!(z <= -1.6e-124) && (z <= 2.6e-135))) {
tmp = 1.0 + (x / (y * t));
} else {
tmp = 1.0 - ((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) :: tmp
if (z <= (-2400.0d0)) then
tmp = 1.0d0 - ((x / z) / t)
else if ((z <= (-4.7d-73)) .or. (.not. (z <= (-1.6d-124))) .and. (z <= 2.6d-135)) then
tmp = 1.0d0 + (x / (y * t))
else
tmp = 1.0d0 - ((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 tmp;
if (z <= -2400.0) {
tmp = 1.0 - ((x / z) / t);
} else if ((z <= -4.7e-73) || (!(z <= -1.6e-124) && (z <= 2.6e-135))) {
tmp = 1.0 + (x / (y * t));
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -2400.0: tmp = 1.0 - ((x / z) / t) elif (z <= -4.7e-73) or (not (z <= -1.6e-124) and (z <= 2.6e-135)): tmp = 1.0 + (x / (y * t)) else: tmp = 1.0 - ((x / t) / z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -2400.0) tmp = Float64(1.0 - Float64(Float64(x / z) / t)); elseif ((z <= -4.7e-73) || (!(z <= -1.6e-124) && (z <= 2.6e-135))) tmp = Float64(1.0 + Float64(x / Float64(y * t))); else tmp = Float64(1.0 - Float64(Float64(x / t) / z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -2400.0)
tmp = 1.0 - ((x / z) / t);
elseif ((z <= -4.7e-73) || (~((z <= -1.6e-124)) && (z <= 2.6e-135)))
tmp = 1.0 + (x / (y * t));
else
tmp = 1.0 - ((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_] := If[LessEqual[z, -2400.0], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -4.7e-73], And[N[Not[LessEqual[z, -1.6e-124]], $MachinePrecision], LessEqual[z, 2.6e-135]]], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2400:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-73} \lor \neg \left(z \leq -1.6 \cdot 10^{-124}\right) \land z \leq 2.6 \cdot 10^{-135}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\end{array}
\end{array}
if z < -2400Initial program 99.9%
Taylor expanded in y around 0 86.2%
*-un-lft-identity86.2%
times-frac86.2%
Applied egg-rr86.2%
associate-*l/86.3%
*-un-lft-identity86.3%
Applied egg-rr86.3%
if -2400 < z < -4.69999999999999994e-73 or -1.60000000000000002e-124 < z < 2.60000000000000004e-135Initial program 96.9%
Taylor expanded in z around 0 85.0%
associate-/r*85.1%
Simplified85.1%
Taylor expanded in y around 0 65.6%
mul-1-neg65.6%
distribute-neg-frac265.6%
*-commutative65.6%
distribute-rgt-neg-out65.6%
Simplified65.6%
if -4.69999999999999994e-73 < z < -1.60000000000000002e-124 or 2.60000000000000004e-135 < z Initial program 99.0%
Taylor expanded in y around 0 74.7%
*-un-lft-identity74.7%
times-frac75.6%
Applied egg-rr75.6%
associate-*r/72.1%
associate-*l/72.2%
*-un-lft-identity72.2%
Applied egg-rr72.2%
Final simplification72.7%
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 -4.2e-275)
(- 1.0 (/ (/ x z) t))
(if (<= t 5.6e-45)
(+ 1.0 (/ x (* y z)))
(if (<= t 4.6e+214) (+ 1.0 (/ x (* y t))) (- 1.0 (/ x (* z t)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.2e-275) {
tmp = 1.0 - ((x / z) / t);
} else if (t <= 5.6e-45) {
tmp = 1.0 + (x / (y * z));
} else if (t <= 4.6e+214) {
tmp = 1.0 + (x / (y * t));
} else {
tmp = 1.0 - (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 (t <= (-4.2d-275)) then
tmp = 1.0d0 - ((x / z) / t)
else if (t <= 5.6d-45) then
tmp = 1.0d0 + (x / (y * z))
else if (t <= 4.6d+214) then
tmp = 1.0d0 + (x / (y * t))
else
tmp = 1.0d0 - (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 (t <= -4.2e-275) {
tmp = 1.0 - ((x / z) / t);
} else if (t <= 5.6e-45) {
tmp = 1.0 + (x / (y * z));
} else if (t <= 4.6e+214) {
tmp = 1.0 + (x / (y * t));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -4.2e-275: tmp = 1.0 - ((x / z) / t) elif t <= 5.6e-45: tmp = 1.0 + (x / (y * z)) elif t <= 4.6e+214: tmp = 1.0 + (x / (y * t)) else: tmp = 1.0 - (x / (z * t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -4.2e-275) tmp = Float64(1.0 - Float64(Float64(x / z) / t)); elseif (t <= 5.6e-45) tmp = Float64(1.0 + Float64(x / Float64(y * z))); elseif (t <= 4.6e+214) tmp = Float64(1.0 + Float64(x / Float64(y * t))); else tmp = Float64(1.0 - Float64(x / Float64(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 <= -4.2e-275)
tmp = 1.0 - ((x / z) / t);
elseif (t <= 5.6e-45)
tmp = 1.0 + (x / (y * z));
elseif (t <= 4.6e+214)
tmp = 1.0 + (x / (y * t));
else
tmp = 1.0 - (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[LessEqual[t, -4.2e-275], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.6e-45], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e+214], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{-275}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{-45}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+214}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if t < -4.19999999999999976e-275Initial program 98.3%
Taylor expanded in y around 0 69.9%
*-un-lft-identity69.9%
times-frac70.0%
Applied egg-rr70.0%
associate-*l/70.0%
*-un-lft-identity70.0%
Applied egg-rr70.0%
if -4.19999999999999976e-275 < t < 5.6000000000000003e-45Initial program 96.5%
Taylor expanded in t around 0 87.5%
Taylor expanded in y around 0 69.1%
associate-*r/69.1%
neg-mul-169.1%
*-commutative69.1%
Simplified69.1%
if 5.6000000000000003e-45 < t < 4.5999999999999998e214Initial program 99.9%
Taylor expanded in z around 0 71.9%
associate-/r*70.4%
Simplified70.4%
Taylor expanded in y around 0 67.4%
mul-1-neg67.4%
distribute-neg-frac267.4%
*-commutative67.4%
distribute-rgt-neg-out67.4%
Simplified67.4%
if 4.5999999999999998e214 < t Initial program 99.9%
Taylor expanded in y around 0 95.7%
Final simplification71.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 (<= t -4.2e-275)
(- 1.0 (/ (/ x z) t))
(if (<= t 6e-45)
(+ 1.0 (/ (/ x y) z))
(if (<= t 2.5e+212) (+ 1.0 (/ x (* y t))) (- 1.0 (/ x (* z t)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.2e-275) {
tmp = 1.0 - ((x / z) / t);
} else if (t <= 6e-45) {
tmp = 1.0 + ((x / y) / z);
} else if (t <= 2.5e+212) {
tmp = 1.0 + (x / (y * t));
} else {
tmp = 1.0 - (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 (t <= (-4.2d-275)) then
tmp = 1.0d0 - ((x / z) / t)
else if (t <= 6d-45) then
tmp = 1.0d0 + ((x / y) / z)
else if (t <= 2.5d+212) then
tmp = 1.0d0 + (x / (y * t))
else
tmp = 1.0d0 - (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 (t <= -4.2e-275) {
tmp = 1.0 - ((x / z) / t);
} else if (t <= 6e-45) {
tmp = 1.0 + ((x / y) / z);
} else if (t <= 2.5e+212) {
tmp = 1.0 + (x / (y * t));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -4.2e-275: tmp = 1.0 - ((x / z) / t) elif t <= 6e-45: tmp = 1.0 + ((x / y) / z) elif t <= 2.5e+212: tmp = 1.0 + (x / (y * t)) else: tmp = 1.0 - (x / (z * t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -4.2e-275) tmp = Float64(1.0 - Float64(Float64(x / z) / t)); elseif (t <= 6e-45) tmp = Float64(1.0 + Float64(Float64(x / y) / z)); elseif (t <= 2.5e+212) tmp = Float64(1.0 + Float64(x / Float64(y * t))); else tmp = Float64(1.0 - Float64(x / Float64(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 <= -4.2e-275)
tmp = 1.0 - ((x / z) / t);
elseif (t <= 6e-45)
tmp = 1.0 + ((x / y) / z);
elseif (t <= 2.5e+212)
tmp = 1.0 + (x / (y * t));
else
tmp = 1.0 - (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[LessEqual[t, -4.2e-275], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e-45], N[(1.0 + N[(N[(x / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e+212], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{-275}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-45}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+212}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if t < -4.19999999999999976e-275Initial program 98.3%
Taylor expanded in y around 0 69.9%
*-un-lft-identity69.9%
times-frac70.0%
Applied egg-rr70.0%
associate-*l/70.0%
*-un-lft-identity70.0%
Applied egg-rr70.0%
if -4.19999999999999976e-275 < t < 6.00000000000000022e-45Initial program 96.5%
Taylor expanded in t around 0 87.5%
Taylor expanded in y around 0 69.1%
mul-1-neg69.1%
associate-/r*69.2%
distribute-neg-frac269.2%
Simplified69.2%
if 6.00000000000000022e-45 < t < 2.49999999999999996e212Initial program 99.9%
Taylor expanded in z around 0 71.9%
associate-/r*70.4%
Simplified70.4%
Taylor expanded in y around 0 67.4%
mul-1-neg67.4%
distribute-neg-frac267.4%
*-commutative67.4%
distribute-rgt-neg-out67.4%
Simplified67.4%
if 2.49999999999999996e212 < t Initial program 99.9%
Taylor expanded in y around 0 95.7%
Final simplification71.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= y -3.5e-101) (not (<= y 1.8e-58))) (+ 1.0 (/ x (* y (- t y)))) (- 1.0 (/ (/ x t) z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.5e-101) || !(y <= 1.8e-58)) {
tmp = 1.0 + (x / (y * (t - y)));
} else {
tmp = 1.0 - ((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) :: tmp
if ((y <= (-3.5d-101)) .or. (.not. (y <= 1.8d-58))) then
tmp = 1.0d0 + (x / (y * (t - y)))
else
tmp = 1.0d0 - ((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 tmp;
if ((y <= -3.5e-101) || !(y <= 1.8e-58)) {
tmp = 1.0 + (x / (y * (t - y)));
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -3.5e-101) or not (y <= 1.8e-58): tmp = 1.0 + (x / (y * (t - y))) else: tmp = 1.0 - ((x / t) / z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -3.5e-101) || !(y <= 1.8e-58)) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); else tmp = Float64(1.0 - Float64(Float64(x / t) / z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((y <= -3.5e-101) || ~((y <= 1.8e-58)))
tmp = 1.0 + (x / (y * (t - y)));
else
tmp = 1.0 - ((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_] := If[Or[LessEqual[y, -3.5e-101], N[Not[LessEqual[y, 1.8e-58]], $MachinePrecision]], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-101} \lor \neg \left(y \leq 1.8 \cdot 10^{-58}\right):\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\end{array}
\end{array}
if y < -3.49999999999999994e-101 or 1.80000000000000005e-58 < y Initial program 99.9%
Taylor expanded in z around 0 89.7%
if -3.49999999999999994e-101 < y < 1.80000000000000005e-58Initial program 96.2%
Taylor expanded in y around 0 80.7%
*-un-lft-identity80.7%
times-frac79.8%
Applied egg-rr79.8%
associate-*r/78.0%
associate-*l/78.1%
*-un-lft-identity78.1%
Applied egg-rr78.1%
Final simplification85.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 (or (<= t -5.1e-185) (not (<= t 1.7e-95))) (+ 1.0 (/ x (* (- y z) t))) (+ 1.0 (/ (/ x y) (- z y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.1e-185) || !(t <= 1.7e-95)) {
tmp = 1.0 + (x / ((y - z) * t));
} else {
tmp = 1.0 + ((x / y) / (z - y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-5.1d-185)) .or. (.not. (t <= 1.7d-95))) then
tmp = 1.0d0 + (x / ((y - z) * t))
else
tmp = 1.0d0 + ((x / y) / (z - y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.1e-185) || !(t <= 1.7e-95)) {
tmp = 1.0 + (x / ((y - z) * t));
} else {
tmp = 1.0 + ((x / y) / (z - y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (t <= -5.1e-185) or not (t <= 1.7e-95): tmp = 1.0 + (x / ((y - z) * t)) else: tmp = 1.0 + ((x / y) / (z - y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((t <= -5.1e-185) || !(t <= 1.7e-95)) tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * t))); else tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((t <= -5.1e-185) || ~((t <= 1.7e-95)))
tmp = 1.0 + (x / ((y - z) * t));
else
tmp = 1.0 + ((x / y) / (z - y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5.1e-185], N[Not[LessEqual[t, 1.7e-95]], $MachinePrecision]], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.1 \cdot 10^{-185} \lor \neg \left(t \leq 1.7 \cdot 10^{-95}\right):\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\end{array}
\end{array}
if t < -5.1000000000000003e-185 or 1.69999999999999997e-95 < t Initial program 99.4%
Taylor expanded in t around inf 91.8%
associate-*r/91.8%
neg-mul-191.8%
Simplified91.8%
if -5.1000000000000003e-185 < t < 1.69999999999999997e-95Initial program 95.9%
Taylor expanded in t around 0 88.8%
associate-/r*88.8%
Simplified88.8%
Final simplification91.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 -2.06e-106) (+ 1.0 (/ x (* y (- t y)))) (if (<= y 3.2e-56) (- 1.0 (/ (/ x t) z)) (+ 1.0 (/ (/ x y) (- t y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.06e-106) {
tmp = 1.0 + (x / (y * (t - y)));
} else if (y <= 3.2e-56) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0 + ((x / y) / (t - y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.06d-106)) then
tmp = 1.0d0 + (x / (y * (t - y)))
else if (y <= 3.2d-56) then
tmp = 1.0d0 - ((x / t) / z)
else
tmp = 1.0d0 + ((x / y) / (t - y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.06e-106) {
tmp = 1.0 + (x / (y * (t - y)));
} else if (y <= 3.2e-56) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0 + ((x / y) / (t - y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -2.06e-106: tmp = 1.0 + (x / (y * (t - y))) elif y <= 3.2e-56: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 + ((x / y) / (t - y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.06e-106) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); elseif (y <= 3.2e-56) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); else tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(t - y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -2.06e-106)
tmp = 1.0 + (x / (y * (t - y)));
elseif (y <= 3.2e-56)
tmp = 1.0 - ((x / t) / z);
else
tmp = 1.0 + ((x / y) / (t - y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -2.06e-106], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-56], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.06 \cdot 10^{-106}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-56}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\
\end{array}
\end{array}
if y < -2.06000000000000007e-106Initial program 99.9%
Taylor expanded in z around 0 87.9%
if -2.06000000000000007e-106 < y < 3.19999999999999986e-56Initial program 96.2%
Taylor expanded in y around 0 80.7%
*-un-lft-identity80.7%
times-frac79.8%
Applied egg-rr79.8%
associate-*r/78.0%
associate-*l/78.1%
*-un-lft-identity78.1%
Applied egg-rr78.1%
if 3.19999999999999986e-56 < y Initial program 99.9%
Taylor expanded in z around 0 91.6%
associate-/r*91.6%
Simplified91.6%
Final simplification85.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 (<= t -4.5e-185)
(- 1.0 (/ (/ x z) (- t y)))
(if (<= t 6.5e-95)
(- 1.0 (/ (/ x y) (- y z)))
(+ 1.0 (/ 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 <= -4.5e-185) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (t <= 6.5e-95) {
tmp = 1.0 - ((x / y) / (y - z));
} else {
tmp = 1.0 + (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 <= (-4.5d-185)) then
tmp = 1.0d0 - ((x / z) / (t - y))
else if (t <= 6.5d-95) then
tmp = 1.0d0 - ((x / y) / (y - z))
else
tmp = 1.0d0 + (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 <= -4.5e-185) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (t <= 6.5e-95) {
tmp = 1.0 - ((x / y) / (y - z));
} else {
tmp = 1.0 + (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 <= -4.5e-185: tmp = 1.0 - ((x / z) / (t - y)) elif t <= 6.5e-95: tmp = 1.0 - ((x / y) / (y - z)) else: tmp = 1.0 + (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 <= -4.5e-185) tmp = Float64(1.0 - Float64(Float64(x / z) / Float64(t - y))); elseif (t <= 6.5e-95) tmp = Float64(1.0 - Float64(Float64(x / y) / Float64(y - z))); else tmp = Float64(1.0 + 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 <= -4.5e-185)
tmp = 1.0 - ((x / z) / (t - y));
elseif (t <= 6.5e-95)
tmp = 1.0 - ((x / y) / (y - z));
else
tmp = 1.0 + (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, -4.5e-185], N[(1.0 - N[(N[(x / z), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.5e-95], N[(1.0 - N[(N[(x / y), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{-185}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t - y}\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-95}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -4.5000000000000001e-185Initial program 99.0%
Taylor expanded in z around inf 85.6%
mul-1-neg85.6%
associate-/r*84.7%
distribute-neg-frac84.7%
Simplified84.7%
if -4.5000000000000001e-185 < t < 6.49999999999999985e-95Initial program 95.9%
Taylor expanded in t around 0 88.8%
associate-/r*88.8%
Simplified88.8%
if 6.49999999999999985e-95 < t Initial program 99.9%
Taylor expanded in t around inf 96.7%
associate-*r/96.7%
neg-mul-196.7%
Simplified96.7%
Final simplification89.8%
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.4e-188)
(- 1.0 (/ (/ x z) (- t y)))
(if (<= t 1.9e-95)
(- 1.0 (/ (/ x y) (- y z)))
(+ 1.0 (/ (/ x t) (- y z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.4e-188) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (t <= 1.9e-95) {
tmp = 1.0 - ((x / y) / (y - z));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.4d-188)) then
tmp = 1.0d0 - ((x / z) / (t - y))
else if (t <= 1.9d-95) then
tmp = 1.0d0 - ((x / y) / (y - z))
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.4e-188) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (t <= 1.9e-95) {
tmp = 1.0 - ((x / y) / (y - z));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -1.4e-188: tmp = 1.0 - ((x / z) / (t - y)) elif t <= 1.9e-95: tmp = 1.0 - ((x / y) / (y - z)) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -1.4e-188) tmp = Float64(1.0 - Float64(Float64(x / z) / Float64(t - y))); elseif (t <= 1.9e-95) tmp = Float64(1.0 - Float64(Float64(x / y) / Float64(y - z))); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -1.4e-188)
tmp = 1.0 - ((x / z) / (t - y));
elseif (t <= 1.9e-95)
tmp = 1.0 - ((x / y) / (y - z));
else
tmp = 1.0 + ((x / t) / (y - z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -1.4e-188], N[(1.0 - N[(N[(x / z), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e-95], N[(1.0 - N[(N[(x / y), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{-188}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t - y}\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-95}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.4000000000000001e-188Initial program 99.0%
Taylor expanded in z around inf 85.6%
mul-1-neg85.6%
associate-/r*84.7%
distribute-neg-frac84.7%
Simplified84.7%
if -1.4000000000000001e-188 < t < 1.8999999999999999e-95Initial program 95.9%
Taylor expanded in t around 0 88.8%
associate-/r*88.8%
Simplified88.8%
if 1.8999999999999999e-95 < t Initial program 99.9%
*-un-lft-identity99.9%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 96.7%
mul-1-neg96.7%
associate-/r*96.8%
distribute-neg-frac296.8%
sub-neg96.8%
neg-mul-196.8%
+-commutative96.8%
distribute-neg-in96.8%
neg-mul-196.8%
remove-double-neg96.8%
Simplified96.8%
Final simplification89.8%
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 -1.6e+18) (not (<= y 2.5e-28))) (- 1.0 (/ x (* y z))) (- 1.0 (/ x (* z t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.6e+18) || !(y <= 2.5e-28)) {
tmp = 1.0 - (x / (y * z));
} else {
tmp = 1.0 - (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 <= (-1.6d+18)) .or. (.not. (y <= 2.5d-28))) then
tmp = 1.0d0 - (x / (y * z))
else
tmp = 1.0d0 - (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 <= -1.6e+18) || !(y <= 2.5e-28)) {
tmp = 1.0 - (x / (y * z));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -1.6e+18) or not (y <= 2.5e-28): tmp = 1.0 - (x / (y * z)) else: tmp = 1.0 - (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 <= -1.6e+18) || !(y <= 2.5e-28)) tmp = Float64(1.0 - Float64(x / Float64(y * z))); else tmp = Float64(1.0 - Float64(x / Float64(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 <= -1.6e+18) || ~((y <= 2.5e-28)))
tmp = 1.0 - (x / (y * z));
else
tmp = 1.0 - (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, -1.6e+18], N[Not[LessEqual[y, 2.5e-28]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+18} \lor \neg \left(y \leq 2.5 \cdot 10^{-28}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -1.6e18 or 2.5000000000000001e-28 < y Initial program 100.0%
Taylor expanded in t around 0 97.5%
Taylor expanded in y around 0 74.0%
associate-*r/74.0%
neg-mul-174.0%
*-commutative74.0%
Simplified74.0%
add-sqr-sqrt36.6%
sqrt-unprod67.7%
sqr-neg67.7%
sqrt-unprod37.5%
add-sqr-sqrt73.3%
*-un-lft-identity73.3%
*-commutative73.3%
Applied egg-rr73.3%
*-lft-identity73.3%
*-commutative73.3%
Simplified73.3%
if -1.6e18 < y < 2.5000000000000001e-28Initial program 97.1%
Taylor expanded in y around 0 74.8%
Final simplification74.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 (or (<= y -7.6e+17) (not (<= y 7.5e-28))) (- 1.0 (/ x (* y z))) (- 1.0 (/ (/ x t) z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.6e+17) || !(y <= 7.5e-28)) {
tmp = 1.0 - (x / (y * z));
} else {
tmp = 1.0 - ((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) :: tmp
if ((y <= (-7.6d+17)) .or. (.not. (y <= 7.5d-28))) then
tmp = 1.0d0 - (x / (y * z))
else
tmp = 1.0d0 - ((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 tmp;
if ((y <= -7.6e+17) || !(y <= 7.5e-28)) {
tmp = 1.0 - (x / (y * z));
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -7.6e+17) or not (y <= 7.5e-28): tmp = 1.0 - (x / (y * z)) else: tmp = 1.0 - ((x / t) / z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -7.6e+17) || !(y <= 7.5e-28)) tmp = Float64(1.0 - Float64(x / Float64(y * z))); else tmp = Float64(1.0 - Float64(Float64(x / t) / z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((y <= -7.6e+17) || ~((y <= 7.5e-28)))
tmp = 1.0 - (x / (y * z));
else
tmp = 1.0 - ((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_] := If[Or[LessEqual[y, -7.6e+17], N[Not[LessEqual[y, 7.5e-28]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+17} \lor \neg \left(y \leq 7.5 \cdot 10^{-28}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\end{array}
\end{array}
if y < -7.6e17 or 7.5000000000000003e-28 < y Initial program 100.0%
Taylor expanded in t around 0 97.5%
Taylor expanded in y around 0 74.0%
associate-*r/74.0%
neg-mul-174.0%
*-commutative74.0%
Simplified74.0%
add-sqr-sqrt36.6%
sqrt-unprod67.7%
sqr-neg67.7%
sqrt-unprod37.5%
add-sqr-sqrt73.3%
*-un-lft-identity73.3%
*-commutative73.3%
Applied egg-rr73.3%
*-lft-identity73.3%
*-commutative73.3%
Simplified73.3%
if -7.6e17 < y < 7.5000000000000003e-28Initial program 97.1%
Taylor expanded in y around 0 74.8%
*-un-lft-identity74.8%
times-frac74.1%
Applied egg-rr74.1%
associate-*r/72.7%
associate-*l/72.8%
*-un-lft-identity72.8%
Applied egg-rr72.8%
Final simplification73.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 1.0 (/ x (* (- y z) (- t y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + (x / ((y - z) * (t - y)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (x / ((y - z) * (t - y)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(Float64(y - z) * Float64(t - y)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (x / ((y - z) * (t - y)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{x}{\left(y - z\right) \cdot \left(t - y\right)}
\end{array}
Initial program 98.4%
Final simplification98.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* z t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 - (x / (z * 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 = 1.0d0 - (x / (z * t))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / (z * t));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 - (x / (z * t))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(z * t))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - (x / (z * t));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 - \frac{x}{z \cdot t}
\end{array}
Initial program 98.4%
Taylor expanded in y around 0 64.4%
Final simplification64.4%
herbie shell --seed 2024079
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A"
:precision binary64
(- 1.0 (/ x (* (- y z) (- y t)))))