
(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 12 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}
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z))) (t_2 (/ (/ x (- t z)) (- y z)))) (if (<= t_1 (- INFINITY)) t_2 (if (<= t_1 2e+234) (/ x t_1) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double t_2 = (x / (t - z)) / (y - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= 2e+234) {
tmp = x / t_1;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double t_2 = (x / (t - z)) / (y - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= 2e+234) {
tmp = x / t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) t_2 = (x / (t - z)) / (y - z) tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= 2e+234: tmp = x / t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) t_2 = Float64(Float64(x / Float64(t - z)) / Float64(y - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= 2e+234) tmp = Float64(x / t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); t_2 = (x / (t - z)) / (y - z); tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= 2e+234) tmp = x / t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 2e+234], N[(x / t$95$1), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
t_2 := \frac{\frac{x}{t - z}}{y - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+234}:\\
\;\;\;\;\frac{x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -inf.0 or 2.00000000000000004e234 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 81.3%
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9
Applied egg-rr99.9%
if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < 2.00000000000000004e234Initial program 98.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (* (- y z) (- t z))))) (if (<= t_1 -5e-310) t_1 (/ (/ 1.0 (- z t)) (/ (- z y) x)))))
double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (t - z));
double tmp;
if (t_1 <= -5e-310) {
tmp = t_1;
} else {
tmp = (1.0 / (z - t)) / ((z - 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) :: t_1
real(8) :: tmp
t_1 = x / ((y - z) * (t - z))
if (t_1 <= (-5d-310)) then
tmp = t_1
else
tmp = (1.0d0 / (z - t)) / ((z - y) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (t - z));
double tmp;
if (t_1 <= -5e-310) {
tmp = t_1;
} else {
tmp = (1.0 / (z - t)) / ((z - y) / x);
}
return tmp;
}
def code(x, y, z, t): t_1 = x / ((y - z) * (t - z)) tmp = 0 if t_1 <= -5e-310: tmp = t_1 else: tmp = (1.0 / (z - t)) / ((z - y) / x) return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(y - z) * Float64(t - z))) tmp = 0.0 if (t_1 <= -5e-310) tmp = t_1; else tmp = Float64(Float64(1.0 / Float64(z - t)) / Float64(Float64(z - y) / x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / ((y - z) * (t - z)); tmp = 0.0; if (t_1 <= -5e-310) tmp = t_1; else tmp = (1.0 / (z - t)) / ((z - y) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-310], t$95$1, N[(N[(1.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z - t}}{\frac{z - y}{x}}\\
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -4.999999999999985e-310Initial program 97.6%
if -4.999999999999985e-310 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 88.2%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.7
Applied egg-rr97.7%
div-invN/A
clear-numN/A
associate-*l/N/A
div-invN/A
frac-2negN/A
distribute-frac-neg2N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
sub-negN/A
flip3--N/A
clear-numN/A
/-lowering-/.f64N/A
Applied egg-rr97.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (* (- y z) (- t z))))) (if (<= t_1 -5e-310) t_1 (/ (/ x (- y z)) (- t z)))))
double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (t - z));
double tmp;
if (t_1 <= -5e-310) {
tmp = t_1;
} else {
tmp = (x / (y - z)) / (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) :: t_1
real(8) :: tmp
t_1 = x / ((y - z) * (t - z))
if (t_1 <= (-5d-310)) then
tmp = t_1
else
tmp = (x / (y - z)) / (t - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (t - z));
double tmp;
if (t_1 <= -5e-310) {
tmp = t_1;
} else {
tmp = (x / (y - z)) / (t - z);
}
return tmp;
}
def code(x, y, z, t): t_1 = x / ((y - z) * (t - z)) tmp = 0 if t_1 <= -5e-310: tmp = t_1 else: tmp = (x / (y - z)) / (t - z) return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(y - z) * Float64(t - z))) tmp = 0.0 if (t_1 <= -5e-310) tmp = t_1; else tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / ((y - z) * (t - z)); tmp = 0.0; if (t_1 <= -5e-310) tmp = t_1; else tmp = (x / (y - z)) / (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-310], t$95$1, N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -4.999999999999985e-310Initial program 97.6%
if -4.999999999999985e-310 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 88.2%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.7
Applied egg-rr97.7%
(FPCore (x y z t) :precision binary64 (if (<= y -1.8e-83) (/ x (* y (- t z))) (if (<= y 6.5e-177) (/ x (* z (- z t))) (/ x (* (- y z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.8e-83) {
tmp = x / (y * (t - z));
} else if (y <= 6.5e-177) {
tmp = x / (z * (z - t));
} else {
tmp = x / ((y - z) * 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 (y <= (-1.8d-83)) then
tmp = x / (y * (t - z))
else if (y <= 6.5d-177) then
tmp = x / (z * (z - t))
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.8e-83) {
tmp = x / (y * (t - z));
} else if (y <= 6.5e-177) {
tmp = x / (z * (z - t));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.8e-83: tmp = x / (y * (t - z)) elif y <= 6.5e-177: tmp = x / (z * (z - t)) else: tmp = x / ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.8e-83) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 6.5e-177) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.8e-83) tmp = x / (y * (t - z)); elseif (y <= 6.5e-177) tmp = x / (z * (z - t)); else tmp = x / ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.8e-83], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e-177], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-83}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-177}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -1.80000000000000006e-83Initial program 85.6%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6479.3
Simplified79.3%
if -1.80000000000000006e-83 < y < 6.4999999999999998e-177Initial program 91.2%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
unsub-negN/A
--lowering--.f6481.1
Simplified81.1%
if 6.4999999999999998e-177 < y Initial program 94.2%
Taylor expanded in t around inf
Simplified54.0%
Final simplification70.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (* y (- t z))))) (if (<= y -1.45e-90) t_1 (if (<= y 1.5e-99) (/ x (* z (- z t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x / (y * (t - z));
double tmp;
if (y <= -1.45e-90) {
tmp = t_1;
} else if (y <= 1.5e-99) {
tmp = x / (z * (z - t));
} else {
tmp = 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 = x / (y * (t - z))
if (y <= (-1.45d-90)) then
tmp = t_1
else if (y <= 1.5d-99) then
tmp = x / (z * (z - t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (y * (t - z));
double tmp;
if (y <= -1.45e-90) {
tmp = t_1;
} else if (y <= 1.5e-99) {
tmp = x / (z * (z - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (y * (t - z)) tmp = 0 if y <= -1.45e-90: tmp = t_1 elif y <= 1.5e-99: tmp = x / (z * (z - t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(y * Float64(t - z))) tmp = 0.0 if (y <= -1.45e-90) tmp = t_1; elseif (y <= 1.5e-99) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (y * (t - z)); tmp = 0.0; if (y <= -1.45e-90) tmp = t_1; elseif (y <= 1.5e-99) tmp = x / (z * (z - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.45e-90], t$95$1, If[LessEqual[y, 1.5e-99], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{if}\;y \leq -1.45 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-99}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.44999999999999992e-90 or 1.50000000000000003e-99 < y Initial program 89.7%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6476.0
Simplified76.0%
if -1.44999999999999992e-90 < y < 1.50000000000000003e-99Initial program 92.0%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
unsub-negN/A
--lowering--.f6482.7
Simplified82.7%
Final simplification78.1%
(FPCore (x y z t) :precision binary64 (if (<= z -6.4e-90) (/ x (* z (- z y))) (if (<= z 1.55e-134) (/ x (* y t)) (/ x (* z (- z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.4e-90) {
tmp = x / (z * (z - y));
} else if (z <= 1.55e-134) {
tmp = x / (y * t);
} else {
tmp = x / (z * (z - 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 <= (-6.4d-90)) then
tmp = x / (z * (z - y))
else if (z <= 1.55d-134) then
tmp = x / (y * t)
else
tmp = x / (z * (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.4e-90) {
tmp = x / (z * (z - y));
} else if (z <= 1.55e-134) {
tmp = x / (y * t);
} else {
tmp = x / (z * (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.4e-90: tmp = x / (z * (z - y)) elif z <= 1.55e-134: tmp = x / (y * t) else: tmp = x / (z * (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.4e-90) tmp = Float64(x / Float64(z * Float64(z - y))); elseif (z <= 1.55e-134) tmp = Float64(x / Float64(y * t)); else tmp = Float64(x / Float64(z * Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6.4e-90) tmp = x / (z * (z - y)); elseif (z <= 1.55e-134) tmp = x / (y * t); else tmp = x / (z * (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.4e-90], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e-134], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{-90}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-134}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\end{array}
\end{array}
if z < -6.40000000000000014e-90Initial program 87.4%
Taylor expanded in t around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
unsub-negN/A
--lowering--.f6474.0
Simplified74.0%
if -6.40000000000000014e-90 < z < 1.55000000000000003e-134Initial program 96.0%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6473.9
Simplified73.9%
if 1.55000000000000003e-134 < z Initial program 88.2%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
unsub-negN/A
--lowering--.f6469.7
Simplified69.7%
Final simplification72.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (* z (- z t))))) (if (<= z -3.2e-72) t_1 (if (<= z 6.4e-131) (/ x (* y t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - t));
double tmp;
if (z <= -3.2e-72) {
tmp = t_1;
} else if (z <= 6.4e-131) {
tmp = x / (y * t);
} else {
tmp = 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 = x / (z * (z - t))
if (z <= (-3.2d-72)) then
tmp = t_1
else if (z <= 6.4d-131) then
tmp = x / (y * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - t));
double tmp;
if (z <= -3.2e-72) {
tmp = t_1;
} else if (z <= 6.4e-131) {
tmp = x / (y * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * (z - t)) tmp = 0 if z <= -3.2e-72: tmp = t_1 elif z <= 6.4e-131: tmp = x / (y * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z * Float64(z - t))) tmp = 0.0 if (z <= -3.2e-72) tmp = t_1; elseif (z <= 6.4e-131) tmp = Float64(x / Float64(y * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z * (z - t)); tmp = 0.0; if (z <= -3.2e-72) tmp = t_1; elseif (z <= 6.4e-131) tmp = x / (y * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e-72], t$95$1, If[LessEqual[z, 6.4e-131], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-131}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.19999999999999999e-72 or 6.3999999999999999e-131 < z Initial program 87.6%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
unsub-negN/A
--lowering--.f6470.6
Simplified70.6%
if -3.19999999999999999e-72 < z < 6.3999999999999999e-131Initial program 96.1%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6472.6
Simplified72.6%
Final simplification71.2%
(FPCore (x y z t) :precision binary64 (if (<= y -1.02e+186) (/ (/ x y) (- t z)) (/ x (* (- y z) (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.02e+186) {
tmp = (x / y) / (t - z);
} else {
tmp = x / ((y - z) * (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.02d+186)) then
tmp = (x / y) / (t - z)
else
tmp = x / ((y - z) * (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.02e+186) {
tmp = (x / y) / (t - z);
} else {
tmp = x / ((y - z) * (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.02e+186: tmp = (x / y) / (t - z) else: tmp = x / ((y - z) * (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.02e+186) tmp = Float64(Float64(x / y) / Float64(t - z)); else tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.02e+186) tmp = (x / y) / (t - z); else tmp = x / ((y - z) * (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.02e+186], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{+186}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\end{array}
\end{array}
if y < -1.01999999999999999e186Initial program 68.0%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6468.0
Simplified68.0%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6492.9
Applied egg-rr92.9%
if -1.01999999999999999e186 < y Initial program 93.1%
(FPCore (x y z t) :precision binary64 (if (<= t 3.1e+221) (/ x (* (- y z) (- t z))) (/ (/ x t) (- y z))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.1e+221) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (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 <= 3.1d+221) then
tmp = x / ((y - z) * (t - z))
else
tmp = (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 <= 3.1e+221) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 3.1e+221: tmp = x / ((y - z) * (t - z)) else: tmp = (x / t) / (y - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 3.1e+221) tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 3.1e+221) tmp = x / ((y - z) * (t - z)); else tmp = (x / t) / (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 3.1e+221], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.1 \cdot 10^{+221}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 3.10000000000000006e221Initial program 91.4%
if 3.10000000000000006e221 < t Initial program 73.2%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6473.2
Applied egg-rr73.2%
Taylor expanded in t around inf
Simplified73.2%
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64100.0
Applied egg-rr100.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (* z z)))) (if (<= z -2.6e-68) t_1 (if (<= z 1.6e-5) (/ x (* y t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -2.6e-68) {
tmp = t_1;
} else if (z <= 1.6e-5) {
tmp = x / (y * t);
} else {
tmp = 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 = x / (z * z)
if (z <= (-2.6d-68)) then
tmp = t_1
else if (z <= 1.6d-5) then
tmp = x / (y * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -2.6e-68) {
tmp = t_1;
} else if (z <= 1.6e-5) {
tmp = x / (y * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * z) tmp = 0 if z <= -2.6e-68: tmp = t_1 elif z <= 1.6e-5: tmp = x / (y * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z * z)) tmp = 0.0 if (z <= -2.6e-68) tmp = t_1; elseif (z <= 1.6e-5) tmp = Float64(x / Float64(y * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z * z); tmp = 0.0; if (z <= -2.6e-68) tmp = t_1; elseif (z <= 1.6e-5) tmp = x / (y * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e-68], t$95$1, If[LessEqual[z, 1.6e-5], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot z}\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{-68}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.5999999999999998e-68 or 1.59999999999999993e-5 < z Initial program 85.8%
Taylor expanded in z around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6466.6
Simplified66.6%
if -2.5999999999999998e-68 < z < 1.59999999999999993e-5Initial program 96.8%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6462.6
Simplified62.6%
Final simplification64.9%
(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}
Initial program 90.4%
(FPCore (x y z t) :precision binary64 (/ x (* y t)))
double code(double x, double y, double z, double t) {
return x / (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 = x / (y * t)
end function
public static double code(double x, double y, double z, double t) {
return x / (y * t);
}
def code(x, y, z, t): return x / (y * t)
function code(x, y, z, t) return Float64(x / Float64(y * t)) end
function tmp = code(x, y, z, t) tmp = x / (y * t); end
code[x_, y_, z_, t_] := N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y \cdot t}
\end{array}
Initial program 90.4%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6437.0
Simplified37.0%
Final simplification37.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z)))) (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) * (t - z)
if ((x / t_1) < 0.0d0) then
tmp = (x / (y - z)) / (t - z)
else
tmp = x * (1.0d0 / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if (x / t_1) < 0.0: tmp = (x / (y - z)) / (t - z) else: tmp = x * (1.0 / t_1) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (Float64(x / t_1) < 0.0) tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); else tmp = Float64(x * Float64(1.0 / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); tmp = 0.0; if ((x / t_1) < 0.0) tmp = (x / (y - z)) / (t - z); else tmp = x * (1.0 / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t\_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024195
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ x (* (- y z) (- t z))) 0) (/ (/ x (- y z)) (- t z)) (* x (/ 1 (* (- y z) (- t z))))))
(/ x (* (- y z) (- t z))))