
(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 15 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}
(FPCore (x y z t) :precision binary64 (+ 1.0 (* (/ (pow (cbrt x) 2.0) (- y t)) (/ (cbrt x) (- z y)))))
double code(double x, double y, double z, double t) {
return 1.0 + ((pow(cbrt(x), 2.0) / (y - t)) * (cbrt(x) / (z - y)));
}
public static double code(double x, double y, double z, double t) {
return 1.0 + ((Math.pow(Math.cbrt(x), 2.0) / (y - t)) * (Math.cbrt(x) / (z - y)));
}
function code(x, y, z, t) return Float64(1.0 + Float64(Float64((cbrt(x) ^ 2.0) / Float64(y - t)) * Float64(cbrt(x) / Float64(z - y)))) end
code[x_, y_, z_, t_] := N[(1.0 + N[(N[(N[Power[N[Power[x, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{{\left(\sqrt[3]{x}\right)}^{2}}{y - t} \cdot \frac{\sqrt[3]{x}}{z - y}
\end{array}
Initial program 98.0%
add-cube-cbrt97.8%
*-commutative97.8%
times-frac99.3%
pow299.3%
Applied egg-rr99.3%
Final simplification99.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.58e-24) (not (<= y 2.2e-55))) (- 1.0 (/ (/ x y) y)) (+ 1.0 (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.58e-24) || !(y <= 2.2e-55)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
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) :: tmp
if ((y <= (-1.58d-24)) .or. (.not. (y <= 2.2d-55))) then
tmp = 1.0d0 - ((x / y) / y)
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.58e-24) || !(y <= 2.2e-55)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.58e-24) or not (y <= 2.2e-55): tmp = 1.0 - ((x / y) / y) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.58e-24) || !(y <= 2.2e-55)) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.58e-24) || ~((y <= 2.2e-55))) tmp = 1.0 - ((x / y) / y); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.58e-24], N[Not[LessEqual[y, 2.2e-55]], $MachinePrecision]], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.58 \cdot 10^{-24} \lor \neg \left(y \leq 2.2 \cdot 10^{-55}\right):\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.5799999999999999e-24 or 2.2e-55 < y Initial program 100.0%
Taylor expanded in z around 0 96.4%
associate-/r*96.4%
Simplified96.4%
Taylor expanded in y around inf 93.4%
if -1.5799999999999999e-24 < y < 2.2e-55Initial program 95.2%
Taylor expanded in t around inf 82.0%
+-commutative82.0%
associate-/r*82.4%
Simplified82.4%
Final simplification88.9%
(FPCore (x y z t) :precision binary64 (if (<= t 6.5e-160) (+ 1.0 (/ (/ x z) (- y t))) (if (<= t 4.9e-56) (- 1.0 (/ (/ x y) y)) (+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 6.5e-160) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 4.9e-56) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
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) :: tmp
if (t <= 6.5d-160) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 4.9d-56) then
tmp = 1.0d0 - ((x / y) / y)
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 6.5e-160) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 4.9e-56) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 6.5e-160: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 4.9e-56: tmp = 1.0 - ((x / y) / y) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 6.5e-160) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 4.9e-56) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 6.5e-160) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 4.9e-56) tmp = 1.0 - ((x / y) / y); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 6.5e-160], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.9e-56], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6.5 \cdot 10^{-160}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{-56}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 6.4999999999999996e-160Initial program 97.0%
Taylor expanded in z around inf 79.5%
+-commutative79.5%
associate-/r*81.0%
Simplified81.0%
if 6.4999999999999996e-160 < t < 4.9e-56Initial program 99.9%
Taylor expanded in z around 0 81.2%
associate-/r*81.4%
Simplified81.4%
Taylor expanded in y around inf 80.5%
if 4.9e-56 < t Initial program 100.0%
Taylor expanded in t around inf 100.0%
+-commutative100.0%
associate-/r*99.9%
Simplified99.9%
Final simplification86.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.58e-24) (not (<= y 8.5e-59))) (- 1.0 (/ (/ x y) y)) (- 1.0 (/ (/ x t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.58e-24) || !(y <= 8.5e-59)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - ((x / t) / z);
}
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) :: tmp
if ((y <= (-1.58d-24)) .or. (.not. (y <= 8.5d-59))) then
tmp = 1.0d0 - ((x / y) / y)
else
tmp = 1.0d0 - ((x / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.58e-24) || !(y <= 8.5e-59)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.58e-24) or not (y <= 8.5e-59): tmp = 1.0 - ((x / y) / y) else: tmp = 1.0 - ((x / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.58e-24) || !(y <= 8.5e-59)) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); else tmp = Float64(1.0 - Float64(Float64(x / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.58e-24) || ~((y <= 8.5e-59))) tmp = 1.0 - ((x / y) / y); else tmp = 1.0 - ((x / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.58e-24], N[Not[LessEqual[y, 8.5e-59]], $MachinePrecision]], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.58 \cdot 10^{-24} \lor \neg \left(y \leq 8.5 \cdot 10^{-59}\right):\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\end{array}
\end{array}
if y < -1.5799999999999999e-24 or 8.49999999999999933e-59 < y Initial program 100.0%
Taylor expanded in z around 0 96.4%
associate-/r*96.4%
Simplified96.4%
Taylor expanded in y around inf 93.4%
if -1.5799999999999999e-24 < y < 8.49999999999999933e-59Initial program 95.2%
clear-num95.2%
inv-pow95.2%
*-commutative95.2%
associate-/l*98.9%
Applied egg-rr98.9%
unpow-198.9%
Simplified98.9%
Taylor expanded in x around 0 95.2%
Taylor expanded in y around 0 71.8%
associate-/r*71.5%
Simplified71.5%
Final simplification84.5%
(FPCore (x y z t) :precision binary64 (if (<= y -7e-131) 1.0 (if (<= y 3.9e-72) (- 1.0 (/ (/ x t) z)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7e-131) {
tmp = 1.0;
} else if (y <= 3.9e-72) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0;
}
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) :: tmp
if (y <= (-7d-131)) then
tmp = 1.0d0
else if (y <= 3.9d-72) then
tmp = 1.0d0 - ((x / t) / z)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7e-131) {
tmp = 1.0;
} else if (y <= 3.9e-72) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7e-131: tmp = 1.0 elif y <= 3.9e-72: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7e-131) tmp = 1.0; elseif (y <= 3.9e-72) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7e-131) tmp = 1.0; elseif (y <= 3.9e-72) tmp = 1.0 - ((x / t) / z); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7e-131], 1.0, If[LessEqual[y, 3.9e-72], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-131}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-72}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -7.0000000000000004e-131 or 3.9e-72 < y Initial program 100.0%
Taylor expanded in x around 0 87.3%
if -7.0000000000000004e-131 < y < 3.9e-72Initial program 94.1%
clear-num94.1%
inv-pow94.1%
*-commutative94.1%
associate-/l*98.7%
Applied egg-rr98.7%
unpow-198.7%
Simplified98.7%
Taylor expanded in x around 0 94.1%
Taylor expanded in y around 0 74.4%
associate-/r*74.1%
Simplified74.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.6e-129) 1.0 (if (<= y 4.5e-72) (- 1.0 (/ x (* t z))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.6e-129) {
tmp = 1.0;
} else if (y <= 4.5e-72) {
tmp = 1.0 - (x / (t * z));
} else {
tmp = 1.0;
}
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) :: tmp
if (y <= (-1.6d-129)) then
tmp = 1.0d0
else if (y <= 4.5d-72) then
tmp = 1.0d0 - (x / (t * z))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.6e-129) {
tmp = 1.0;
} else if (y <= 4.5e-72) {
tmp = 1.0 - (x / (t * z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.6e-129: tmp = 1.0 elif y <= 4.5e-72: tmp = 1.0 - (x / (t * z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.6e-129) tmp = 1.0; elseif (y <= 4.5e-72) tmp = Float64(1.0 - Float64(x / Float64(t * z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.6e-129) tmp = 1.0; elseif (y <= 4.5e-72) tmp = 1.0 - (x / (t * z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.6e-129], 1.0, If[LessEqual[y, 4.5e-72], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-129}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-72}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.6000000000000001e-129 or 4.5e-72 < y Initial program 100.0%
Taylor expanded in x around 0 87.3%
if -1.6000000000000001e-129 < y < 4.5e-72Initial program 94.1%
Taylor expanded in y around 0 74.4%
(FPCore (x y z t) :precision binary64 (if (<= z -3.3e+134) 1.0 (if (<= z -4.8e-166) (+ 1.0 (/ (/ x z) y)) (+ 1.0 (/ (/ x y) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.3e+134) {
tmp = 1.0;
} else if (z <= -4.8e-166) {
tmp = 1.0 + ((x / z) / y);
} else {
tmp = 1.0 + ((x / y) / t);
}
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) :: tmp
if (z <= (-3.3d+134)) then
tmp = 1.0d0
else if (z <= (-4.8d-166)) then
tmp = 1.0d0 + ((x / z) / y)
else
tmp = 1.0d0 + ((x / y) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.3e+134) {
tmp = 1.0;
} else if (z <= -4.8e-166) {
tmp = 1.0 + ((x / z) / y);
} else {
tmp = 1.0 + ((x / y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.3e+134: tmp = 1.0 elif z <= -4.8e-166: tmp = 1.0 + ((x / z) / y) else: tmp = 1.0 + ((x / y) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.3e+134) tmp = 1.0; elseif (z <= -4.8e-166) tmp = Float64(1.0 + Float64(Float64(x / z) / y)); else tmp = Float64(1.0 + Float64(Float64(x / y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.3e+134) tmp = 1.0; elseif (z <= -4.8e-166) tmp = 1.0 + ((x / z) / y); else tmp = 1.0 + ((x / y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.3e+134], 1.0, If[LessEqual[z, -4.8e-166], N[(1.0 + N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+134}:\\
\;\;\;\;1\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-166}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if z < -3.3e134Initial program 100.0%
Taylor expanded in x around 0 91.6%
if -3.3e134 < z < -4.7999999999999997e-166Initial program 96.8%
Taylor expanded in z around inf 83.8%
+-commutative83.8%
associate-/r*86.8%
Simplified86.8%
Taylor expanded in y around inf 64.2%
if -4.7999999999999997e-166 < z Initial program 98.1%
Taylor expanded in t around inf 79.7%
+-commutative79.7%
associate-/r*79.9%
Simplified79.9%
Taylor expanded in y around inf 67.3%
*-commutative67.3%
Simplified67.3%
Taylor expanded in x around 0 67.3%
*-commutative67.3%
associate-/r*67.5%
Simplified67.5%
Final simplification70.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1.1e+138) 1.0 (if (<= z -4.5e-164) (+ 1.0 (/ x (* y z))) (+ 1.0 (/ (/ x y) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.1e+138) {
tmp = 1.0;
} else if (z <= -4.5e-164) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0 + ((x / y) / t);
}
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) :: tmp
if (z <= (-1.1d+138)) then
tmp = 1.0d0
else if (z <= (-4.5d-164)) then
tmp = 1.0d0 + (x / (y * z))
else
tmp = 1.0d0 + ((x / y) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.1e+138) {
tmp = 1.0;
} else if (z <= -4.5e-164) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0 + ((x / y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.1e+138: tmp = 1.0 elif z <= -4.5e-164: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 + ((x / y) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.1e+138) tmp = 1.0; elseif (z <= -4.5e-164) tmp = Float64(1.0 + Float64(x / Float64(y * z))); else tmp = Float64(1.0 + Float64(Float64(x / y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.1e+138) tmp = 1.0; elseif (z <= -4.5e-164) tmp = 1.0 + (x / (y * z)); else tmp = 1.0 + ((x / y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.1e+138], 1.0, If[LessEqual[z, -4.5e-164], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+138}:\\
\;\;\;\;1\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-164}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if z < -1.1e138Initial program 100.0%
Taylor expanded in x around 0 91.6%
if -1.1e138 < z < -4.4999999999999997e-164Initial program 96.8%
Taylor expanded in z around inf 83.8%
+-commutative83.8%
associate-/r*86.8%
Simplified86.8%
Taylor expanded in y around inf 62.7%
if -4.4999999999999997e-164 < z Initial program 98.1%
Taylor expanded in t around inf 79.7%
+-commutative79.7%
associate-/r*79.9%
Simplified79.9%
Taylor expanded in y around inf 67.3%
*-commutative67.3%
Simplified67.3%
Taylor expanded in x around 0 67.3%
*-commutative67.3%
associate-/r*67.5%
Simplified67.5%
Final simplification69.7%
(FPCore (x y z t) :precision binary64 (if (<= z -4.2e-164) (+ 1.0 (/ (/ x z) (- y t))) (+ 1.0 (/ 1.0 (* y (/ (- t y) x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.2e-164) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 + (1.0 / (y * ((t - y) / x)));
}
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) :: tmp
if (z <= (-4.2d-164)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else
tmp = 1.0d0 + (1.0d0 / (y * ((t - y) / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.2e-164) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 + (1.0 / (y * ((t - y) / x)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.2e-164: tmp = 1.0 + ((x / z) / (y - t)) else: tmp = 1.0 + (1.0 / (y * ((t - y) / x))) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.2e-164) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(1.0 + Float64(1.0 / Float64(y * Float64(Float64(t - y) / x)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.2e-164) tmp = 1.0 + ((x / z) / (y - t)); else tmp = 1.0 + (1.0 / (y * ((t - y) / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.2e-164], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(1.0 / N[(y * N[(N[(t - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-164}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{1}{y \cdot \frac{t - y}{x}}\\
\end{array}
\end{array}
if z < -4.1999999999999998e-164Initial program 97.9%
Taylor expanded in z around inf 89.6%
+-commutative89.6%
associate-/r*91.5%
Simplified91.5%
if -4.1999999999999998e-164 < z Initial program 98.1%
clear-num98.1%
inv-pow98.1%
*-commutative98.1%
associate-/l*99.9%
Applied egg-rr99.9%
unpow-199.9%
Simplified99.9%
Taylor expanded in z around 0 82.6%
associate-/l*83.8%
Simplified83.8%
Final simplification86.8%
(FPCore (x y z t) :precision binary64 (if (<= z -4.5e-164) (+ 1.0 (/ (/ x z) (- y t))) (+ 1.0 (/ (/ x y) (- t y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.5e-164) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 + ((x / y) / (t - y));
}
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) :: tmp
if (z <= (-4.5d-164)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else
tmp = 1.0d0 + ((x / y) / (t - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.5e-164) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 + ((x / y) / (t - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.5e-164: tmp = 1.0 + ((x / z) / (y - t)) else: tmp = 1.0 + ((x / y) / (t - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.5e-164) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(t - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.5e-164) tmp = 1.0 + ((x / z) / (y - t)); else tmp = 1.0 + ((x / y) / (t - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.5e-164], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-164}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\
\end{array}
\end{array}
if z < -4.4999999999999997e-164Initial program 97.9%
Taylor expanded in z around inf 89.6%
+-commutative89.6%
associate-/r*91.5%
Simplified91.5%
if -4.4999999999999997e-164 < z Initial program 98.1%
Taylor expanded in z around 0 82.6%
associate-/r*83.8%
Simplified83.8%
Final simplification86.8%
(FPCore (x y z t) :precision binary64 (+ 1.0 (/ 1.0 (* (/ (- y z) x) (- t y)))))
double code(double x, double y, double z, double t) {
return 1.0 + (1.0 / (((y - z) / x) * (t - y)));
}
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
public static double code(double x, double y, double z, double t) {
return 1.0 + (1.0 / (((y - z) / x) * (t - y)));
}
def code(x, y, z, t): return 1.0 + (1.0 / (((y - z) / x) * (t - y)))
function code(x, y, z, t) return Float64(1.0 + Float64(1.0 / Float64(Float64(Float64(y - z) / x) * Float64(t - y)))) end
function tmp = code(x, y, z, t) tmp = 1.0 + (1.0 / (((y - z) / x) * (t - y))); end
code[x_, y_, z_, t_] := N[(1.0 + N[(1.0 / N[(N[(N[(y - z), $MachinePrecision] / x), $MachinePrecision] * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{1}{\frac{y - z}{x} \cdot \left(t - y\right)}
\end{array}
Initial program 98.0%
clear-num98.0%
inv-pow98.0%
*-commutative98.0%
associate-/l*99.5%
Applied egg-rr99.5%
unpow-199.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (if (<= t 6e-246) (+ 1.0 (/ x (* y z))) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 6e-246) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0;
}
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) :: tmp
if (t <= 6d-246) then
tmp = 1.0d0 + (x / (y * z))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 6e-246) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 6e-246: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 6e-246) tmp = Float64(1.0 + Float64(x / Float64(y * z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 6e-246) tmp = 1.0 + (x / (y * z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 6e-246], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6 \cdot 10^{-246}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < 6e-246Initial program 97.3%
Taylor expanded in z around inf 81.6%
+-commutative81.6%
associate-/r*83.2%
Simplified83.2%
Taylor expanded in y around inf 62.3%
if 6e-246 < t Initial program 99.0%
Taylor expanded in x around 0 76.0%
Final simplification68.6%
(FPCore (x y z t) :precision binary64 (if (<= z -1.45e-92) 1.0 (+ 1.0 (/ x (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.45e-92) {
tmp = 1.0;
} else {
tmp = 1.0 + (x / (y * t));
}
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) :: tmp
if (z <= (-1.45d-92)) then
tmp = 1.0d0
else
tmp = 1.0d0 + (x / (y * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.45e-92) {
tmp = 1.0;
} else {
tmp = 1.0 + (x / (y * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.45e-92: tmp = 1.0 else: tmp = 1.0 + (x / (y * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.45e-92) tmp = 1.0; else tmp = Float64(1.0 + Float64(x / Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.45e-92) tmp = 1.0; else tmp = 1.0 + (x / (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.45e-92], 1.0, N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-92}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.44999999999999992e-92Initial program 99.9%
Taylor expanded in x around 0 78.6%
if -1.44999999999999992e-92 < z Initial program 97.1%
Taylor expanded in t around inf 78.7%
+-commutative78.7%
associate-/r*79.5%
Simplified79.5%
Taylor expanded in y around inf 65.2%
*-commutative65.2%
Simplified65.2%
Final simplification69.6%
(FPCore (x y z t) :precision binary64 (+ 1.0 (/ x (* (- y t) (- z y)))))
double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - t) * (z - y)));
}
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 - t) * (z - y)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - t) * (z - y)));
}
def code(x, y, z, t): return 1.0 + (x / ((y - t) * (z - y)))
function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(Float64(y - t) * Float64(z - y)))) end
function tmp = code(x, y, z, t) tmp = 1.0 + (x / ((y - t) * (z - y))); end
code[x_, y_, z_, t_] := N[(1.0 + N[(x / N[(N[(y - t), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{x}{\left(y - t\right) \cdot \left(z - y\right)}
\end{array}
Initial program 98.0%
Final simplification98.0%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
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
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 98.0%
Taylor expanded in x around 0 75.1%
herbie shell --seed 2024116
(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)))))