
(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 13 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 (/ (/ x (- t z)) (- y z)))
double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - 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 / (t - z)) / (y - z)
end function
public static double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
def code(x, y, z, t): return (x / (t - z)) / (y - z)
function code(x, y, z, t) return Float64(Float64(x / Float64(t - z)) / Float64(y - z)) end
function tmp = code(x, y, z, t) tmp = (x / (t - z)) / (y - z); end
code[x_, y_, z_, t_] := N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{t - z}}{y - z}
\end{array}
Initial program 89.7%
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.5
Applied egg-rr98.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- t z) (- y z))))
(if (<= t_1 (- INFINITY))
(/ (/ x (- y z)) t)
(if (<= t_1 1e+282) (/ x t_1) (/ (/ x (- z t)) z)))))
double code(double x, double y, double z, double t) {
double t_1 = (t - z) * (y - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x / (y - z)) / t;
} else if (t_1 <= 1e+282) {
tmp = x / t_1;
} else {
tmp = (x / (z - t)) / z;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (t - z) * (y - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (x / (y - z)) / t;
} else if (t_1 <= 1e+282) {
tmp = x / t_1;
} else {
tmp = (x / (z - t)) / z;
}
return tmp;
}
def code(x, y, z, t): t_1 = (t - z) * (y - z) tmp = 0 if t_1 <= -math.inf: tmp = (x / (y - z)) / t elif t_1 <= 1e+282: tmp = x / t_1 else: tmp = (x / (z - t)) / z return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t - z) * Float64(y - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x / Float64(y - z)) / t); elseif (t_1 <= 1e+282) tmp = Float64(x / t_1); else tmp = Float64(Float64(x / Float64(z - t)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t - z) * (y - z); tmp = 0.0; if (t_1 <= -Inf) tmp = (x / (y - z)) / t; elseif (t_1 <= 1e+282) tmp = x / t_1; else tmp = (x / (z - t)) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$1, 1e+282], N[(x / t$95$1), $MachinePrecision], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - z\right) \cdot \left(y - z\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t}\\
\mathbf{elif}\;t\_1 \leq 10^{+282}:\\
\;\;\;\;\frac{x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z - t}}{z}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -inf.0Initial program 79.7%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0
Applied egg-rr100.0%
Taylor expanded in t around inf
Simplified91.0%
if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < 1.00000000000000003e282Initial program 98.4%
if 1.00000000000000003e282 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 78.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--.f6472.6
Simplified72.6%
*-commutativeN/A
associate-/r*N/A
sub-negN/A
remove-double-negN/A
distribute-neg-inN/A
+-commutativeN/A
sub-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
sub-negN/A
--lowering--.f6486.2
Applied egg-rr86.2%
Final simplification93.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* z z))) (t_2 (- (/ x (* z y)))))
(if (<= z -3.2e+45)
t_1
(if (<= z -1.65e-152)
t_2
(if (<= z 3e-55) (/ x (* t y)) (if (<= z 1.95e+34) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double t_2 = -(x / (z * y));
double tmp;
if (z <= -3.2e+45) {
tmp = t_1;
} else if (z <= -1.65e-152) {
tmp = t_2;
} else if (z <= 3e-55) {
tmp = x / (t * y);
} else if (z <= 1.95e+34) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = x / (z * z)
t_2 = -(x / (z * y))
if (z <= (-3.2d+45)) then
tmp = t_1
else if (z <= (-1.65d-152)) then
tmp = t_2
else if (z <= 3d-55) then
tmp = x / (t * y)
else if (z <= 1.95d+34) then
tmp = t_2
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 t_2 = -(x / (z * y));
double tmp;
if (z <= -3.2e+45) {
tmp = t_1;
} else if (z <= -1.65e-152) {
tmp = t_2;
} else if (z <= 3e-55) {
tmp = x / (t * y);
} else if (z <= 1.95e+34) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * z) t_2 = -(x / (z * y)) tmp = 0 if z <= -3.2e+45: tmp = t_1 elif z <= -1.65e-152: tmp = t_2 elif z <= 3e-55: tmp = x / (t * y) elif z <= 1.95e+34: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z * z)) t_2 = Float64(-Float64(x / Float64(z * y))) tmp = 0.0 if (z <= -3.2e+45) tmp = t_1; elseif (z <= -1.65e-152) tmp = t_2; elseif (z <= 3e-55) tmp = Float64(x / Float64(t * y)); elseif (z <= 1.95e+34) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z * z); t_2 = -(x / (z * y)); tmp = 0.0; if (z <= -3.2e+45) tmp = t_1; elseif (z <= -1.65e-152) tmp = t_2; elseif (z <= 3e-55) tmp = x / (t * y); elseif (z <= 1.95e+34) tmp = t_2; 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]}, Block[{t$95$2 = (-N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[z, -3.2e+45], t$95$1, If[LessEqual[z, -1.65e-152], t$95$2, If[LessEqual[z, 3e-55], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.95e+34], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot z}\\
t_2 := -\frac{x}{z \cdot y}\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-152}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+34}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.2000000000000003e45 or 1.9500000000000001e34 < z Initial program 84.0%
Taylor expanded in z around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6471.3
Simplified71.3%
if -3.2000000000000003e45 < z < -1.64999999999999999e-152 or 3.00000000000000016e-55 < z < 1.9500000000000001e34Initial program 93.8%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6443.3
Simplified43.3%
Taylor expanded in t around 0
mul-1-negN/A
neg-lowering-neg.f6429.0
Simplified29.0%
if -1.64999999999999999e-152 < z < 3.00000000000000016e-55Initial program 94.8%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6477.5
Simplified77.5%
Final simplification65.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* z (- z y)))))
(if (<= z -5.2e-33)
(/ x (* z (- z t)))
(if (<= z -1.65e-152) t_1 (if (<= z 8e-55) (/ x (* t y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - y));
double tmp;
if (z <= -5.2e-33) {
tmp = x / (z * (z - t));
} else if (z <= -1.65e-152) {
tmp = t_1;
} else if (z <= 8e-55) {
tmp = x / (t * y);
} 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 - y))
if (z <= (-5.2d-33)) then
tmp = x / (z * (z - t))
else if (z <= (-1.65d-152)) then
tmp = t_1
else if (z <= 8d-55) then
tmp = x / (t * y)
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 - y));
double tmp;
if (z <= -5.2e-33) {
tmp = x / (z * (z - t));
} else if (z <= -1.65e-152) {
tmp = t_1;
} else if (z <= 8e-55) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * (z - y)) tmp = 0 if z <= -5.2e-33: tmp = x / (z * (z - t)) elif z <= -1.65e-152: tmp = t_1 elif z <= 8e-55: tmp = x / (t * y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z * Float64(z - y))) tmp = 0.0 if (z <= -5.2e-33) tmp = Float64(x / Float64(z * Float64(z - t))); elseif (z <= -1.65e-152) tmp = t_1; elseif (z <= 8e-55) tmp = Float64(x / Float64(t * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z * (z - y)); tmp = 0.0; if (z <= -5.2e-33) tmp = x / (z * (z - t)); elseif (z <= -1.65e-152) tmp = t_1; elseif (z <= 8e-55) tmp = x / (t * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e-33], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.65e-152], t$95$1, If[LessEqual[z, 8e-55], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-152}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.19999999999999988e-33Initial program 83.3%
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.3
Simplified70.3%
if -5.19999999999999988e-33 < z < -1.64999999999999999e-152 or 7.99999999999999996e-55 < z Initial program 89.2%
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
unsub-negN/A
remove-double-negN/A
--lowering--.f6463.5
Simplified63.5%
if -1.64999999999999999e-152 < z < 7.99999999999999996e-55Initial program 94.8%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6477.5
Simplified77.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* z (- z t)))))
(if (<= z -1.22e-39)
t_1
(if (<= z -1.65e-152)
(- (/ x (* z y)))
(if (<= z 9.6e-33) (/ x (* t y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - t));
double tmp;
if (z <= -1.22e-39) {
tmp = t_1;
} else if (z <= -1.65e-152) {
tmp = -(x / (z * y));
} else if (z <= 9.6e-33) {
tmp = x / (t * y);
} 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 <= (-1.22d-39)) then
tmp = t_1
else if (z <= (-1.65d-152)) then
tmp = -(x / (z * y))
else if (z <= 9.6d-33) then
tmp = x / (t * y)
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 <= -1.22e-39) {
tmp = t_1;
} else if (z <= -1.65e-152) {
tmp = -(x / (z * y));
} else if (z <= 9.6e-33) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * (z - t)) tmp = 0 if z <= -1.22e-39: tmp = t_1 elif z <= -1.65e-152: tmp = -(x / (z * y)) elif z <= 9.6e-33: tmp = x / (t * y) 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 <= -1.22e-39) tmp = t_1; elseif (z <= -1.65e-152) tmp = Float64(-Float64(x / Float64(z * y))); elseif (z <= 9.6e-33) tmp = Float64(x / Float64(t * y)); 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 <= -1.22e-39) tmp = t_1; elseif (z <= -1.65e-152) tmp = -(x / (z * y)); elseif (z <= 9.6e-33) tmp = x / (t * y); 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, -1.22e-39], t$95$1, If[LessEqual[z, -1.65e-152], (-N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), If[LessEqual[z, 9.6e-33], N[(x / N[(t * y), $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 -1.22 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-152}:\\
\;\;\;\;-\frac{x}{z \cdot y}\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.2200000000000001e-39 or 9.6e-33 < z Initial program 85.8%
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--.f6474.6
Simplified74.6%
if -1.2200000000000001e-39 < z < -1.64999999999999999e-152Initial program 93.1%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6447.3
Simplified47.3%
Taylor expanded in t around 0
mul-1-negN/A
neg-lowering-neg.f6426.8
Simplified26.8%
if -1.64999999999999999e-152 < z < 9.6e-33Initial program 95.1%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6475.7
Simplified75.7%
Final simplification72.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* z z))))
(if (<= z -7.5e-59)
t_1
(if (<= z 3.2e-30)
(/ x (* t y))
(if (<= z 2.25e+79) (/ x (* t (- z))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -7.5e-59) {
tmp = t_1;
} else if (z <= 3.2e-30) {
tmp = x / (t * y);
} else if (z <= 2.25e+79) {
tmp = x / (t * -z);
} 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 <= (-7.5d-59)) then
tmp = t_1
else if (z <= 3.2d-30) then
tmp = x / (t * y)
else if (z <= 2.25d+79) then
tmp = x / (t * -z)
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 <= -7.5e-59) {
tmp = t_1;
} else if (z <= 3.2e-30) {
tmp = x / (t * y);
} else if (z <= 2.25e+79) {
tmp = x / (t * -z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * z) tmp = 0 if z <= -7.5e-59: tmp = t_1 elif z <= 3.2e-30: tmp = x / (t * y) elif z <= 2.25e+79: tmp = x / (t * -z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z * z)) tmp = 0.0 if (z <= -7.5e-59) tmp = t_1; elseif (z <= 3.2e-30) tmp = Float64(x / Float64(t * y)); elseif (z <= 2.25e+79) tmp = Float64(x / Float64(t * Float64(-z))); 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 <= -7.5e-59) tmp = t_1; elseif (z <= 3.2e-30) tmp = x / (t * y); elseif (z <= 2.25e+79) tmp = x / (t * -z); 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, -7.5e-59], t$95$1, If[LessEqual[z, 3.2e-30], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.25e+79], N[(x / N[(t * (-z)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot z}\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-30}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+79}:\\
\;\;\;\;\frac{x}{t \cdot \left(-z\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.50000000000000019e-59 or 2.24999999999999997e79 < z Initial program 83.9%
Taylor expanded in z around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6469.1
Simplified69.1%
if -7.50000000000000019e-59 < z < 3.2e-30Initial program 94.7%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6470.4
Simplified70.4%
if 3.2e-30 < z < 2.24999999999999997e79Initial program 93.8%
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--.f6472.1
Simplified72.1%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f6450.7
Simplified50.7%
Final simplification67.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (* z (- z t))))) (if (<= z -1.32e-28) t_1 (if (<= z 1.25e-31) (/ x (* (- t z) y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - t));
double tmp;
if (z <= -1.32e-28) {
tmp = t_1;
} else if (z <= 1.25e-31) {
tmp = x / ((t - z) * y);
} 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 <= (-1.32d-28)) then
tmp = t_1
else if (z <= 1.25d-31) then
tmp = x / ((t - z) * y)
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 <= -1.32e-28) {
tmp = t_1;
} else if (z <= 1.25e-31) {
tmp = x / ((t - z) * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * (z - t)) tmp = 0 if z <= -1.32e-28: tmp = t_1 elif z <= 1.25e-31: tmp = x / ((t - z) * y) 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 <= -1.32e-28) tmp = t_1; elseif (z <= 1.25e-31) tmp = Float64(x / Float64(Float64(t - z) * y)); 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 <= -1.32e-28) tmp = t_1; elseif (z <= 1.25e-31) tmp = x / ((t - z) * y); 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, -1.32e-28], t$95$1, If[LessEqual[z, 1.25e-31], N[(x / N[(N[(t - z), $MachinePrecision] * y), $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 -1.32 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-31}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.32000000000000011e-28 or 1.25e-31 < z Initial program 85.7%
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--.f6474.5
Simplified74.5%
if -1.32000000000000011e-28 < z < 1.25e-31Initial program 94.9%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6478.4
Simplified78.4%
(FPCore (x y z t) :precision binary64 (if (<= y -7e+186) (/ (/ x (- t z)) y) (/ x (* (- t z) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7e+186) {
tmp = (x / (t - z)) / y;
} else {
tmp = x / ((t - z) * (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 <= (-7d+186)) then
tmp = (x / (t - z)) / y
else
tmp = x / ((t - z) * (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7e+186) {
tmp = (x / (t - z)) / y;
} else {
tmp = x / ((t - z) * (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7e+186: tmp = (x / (t - z)) / y else: tmp = x / ((t - z) * (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7e+186) tmp = Float64(Float64(x / Float64(t - z)) / y); else tmp = Float64(x / Float64(Float64(t - z) * Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7e+186) tmp = (x / (t - z)) / y; else tmp = x / ((t - z) * (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7e+186], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+186}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -6.99999999999999974e186Initial program 75.7%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6475.7
Simplified75.7%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.7
Applied egg-rr99.7%
if -6.99999999999999974e186 < y Initial program 91.1%
Final simplification91.9%
(FPCore (x y z t) :precision binary64 (if (<= y -7.8e+186) (/ (/ x y) (- t z)) (/ x (* (- t z) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.8e+186) {
tmp = (x / y) / (t - z);
} else {
tmp = x / ((t - z) * (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 <= (-7.8d+186)) then
tmp = (x / y) / (t - z)
else
tmp = x / ((t - z) * (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.8e+186) {
tmp = (x / y) / (t - z);
} else {
tmp = x / ((t - z) * (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.8e+186: tmp = (x / y) / (t - z) else: tmp = x / ((t - z) * (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.8e+186) tmp = Float64(Float64(x / y) / Float64(t - z)); else tmp = Float64(x / Float64(Float64(t - z) * Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.8e+186) tmp = (x / y) / (t - z); else tmp = x / ((t - z) * (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.8e+186], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{+186}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -7.8000000000000002e186Initial program 75.7%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6475.7
Simplified75.7%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6495.7
Applied egg-rr95.7%
if -7.8000000000000002e186 < y Initial program 91.1%
Final simplification91.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (* z z)))) (if (<= z -2.8e-58) t_1 (if (<= z 1.22e+19) (/ x (* t y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -2.8e-58) {
tmp = t_1;
} else if (z <= 1.22e+19) {
tmp = x / (t * y);
} 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.8d-58)) then
tmp = t_1
else if (z <= 1.22d+19) then
tmp = x / (t * y)
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.8e-58) {
tmp = t_1;
} else if (z <= 1.22e+19) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * z) tmp = 0 if z <= -2.8e-58: tmp = t_1 elif z <= 1.22e+19: tmp = x / (t * y) 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.8e-58) tmp = t_1; elseif (z <= 1.22e+19) tmp = Float64(x / Float64(t * y)); 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.8e-58) tmp = t_1; elseif (z <= 1.22e+19) tmp = x / (t * y); 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.8e-58], t$95$1, If[LessEqual[z, 1.22e+19], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot z}\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.22 \cdot 10^{+19}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.8000000000000001e-58 or 1.22e19 < z Initial program 84.9%
Taylor expanded in z around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6464.4
Simplified64.4%
if -2.8000000000000001e-58 < z < 1.22e19Initial program 95.2%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6466.4
Simplified66.4%
(FPCore (x y z t) :precision binary64 (if (<= z -1.5e+193) (/ (/ x z) z) (/ x (* (- t z) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.5e+193) {
tmp = (x / z) / z;
} else {
tmp = x / ((t - z) * (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 (z <= (-1.5d+193)) then
tmp = (x / z) / z
else
tmp = x / ((t - z) * (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.5e+193) {
tmp = (x / z) / z;
} else {
tmp = x / ((t - z) * (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.5e+193: tmp = (x / z) / z else: tmp = x / ((t - z) * (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.5e+193) tmp = Float64(Float64(x / z) / z); else tmp = Float64(x / Float64(Float64(t - z) * Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.5e+193) tmp = (x / z) / z; else tmp = x / ((t - z) * (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.5e+193], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+193}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if z < -1.5e193Initial program 73.0%
Taylor expanded in z around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6473.0
Simplified73.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6489.9
Applied egg-rr89.9%
if -1.5e193 < z Initial program 91.7%
Final simplification91.5%
(FPCore (x y z t) :precision binary64 (/ x (* (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) * (y - 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 / ((t - z) * (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) * (y - z));
}
def code(x, y, z, t): return x / ((t - z) * (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) * Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) * (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}
\end{array}
Initial program 89.7%
Final simplification89.7%
(FPCore (x y z t) :precision binary64 (/ x (* t y)))
double code(double x, double y, double z, double t) {
return 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 = x / (t * y)
end function
public static double code(double x, double y, double z, double t) {
return x / (t * y);
}
def code(x, y, z, t): return x / (t * y)
function code(x, y, z, t) return Float64(x / Float64(t * y)) end
function tmp = code(x, y, z, t) tmp = x / (t * y); end
code[x_, y_, z_, t_] := N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{t \cdot y}
\end{array}
Initial program 89.7%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6443.8
Simplified43.8%
(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 2024204
(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))))