
(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 (/ (/ 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.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6497.6
Applied rewrites97.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* (- z) (- t z)))))
(if (<= z -4.6e+169)
(/ (/ x z) z)
(if (<= z -5.5e-26)
t_1
(if (<= z 7.2e-111)
(/ x (* (- t z) y))
(if (<= z 0.00135) (/ x (* (- y z) t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (-z * (t - z));
double tmp;
if (z <= -4.6e+169) {
tmp = (x / z) / z;
} else if (z <= -5.5e-26) {
tmp = t_1;
} else if (z <= 7.2e-111) {
tmp = x / ((t - z) * y);
} else if (z <= 0.00135) {
tmp = x / ((y - 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 / (-z * (t - z))
if (z <= (-4.6d+169)) then
tmp = (x / z) / z
else if (z <= (-5.5d-26)) then
tmp = t_1
else if (z <= 7.2d-111) then
tmp = x / ((t - z) * y)
else if (z <= 0.00135d0) then
tmp = x / ((y - 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 / (-z * (t - z));
double tmp;
if (z <= -4.6e+169) {
tmp = (x / z) / z;
} else if (z <= -5.5e-26) {
tmp = t_1;
} else if (z <= 7.2e-111) {
tmp = x / ((t - z) * y);
} else if (z <= 0.00135) {
tmp = x / ((y - z) * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (-z * (t - z)) tmp = 0 if z <= -4.6e+169: tmp = (x / z) / z elif z <= -5.5e-26: tmp = t_1 elif z <= 7.2e-111: tmp = x / ((t - z) * y) elif z <= 0.00135: tmp = x / ((y - z) * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(-z) * Float64(t - z))) tmp = 0.0 if (z <= -4.6e+169) tmp = Float64(Float64(x / z) / z); elseif (z <= -5.5e-26) tmp = t_1; elseif (z <= 7.2e-111) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (z <= 0.00135) tmp = Float64(x / Float64(Float64(y - z) * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (-z * (t - z)); tmp = 0.0; if (z <= -4.6e+169) tmp = (x / z) / z; elseif (z <= -5.5e-26) tmp = t_1; elseif (z <= 7.2e-111) tmp = x / ((t - z) * y); elseif (z <= 0.00135) tmp = x / ((y - z) * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[((-z) * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e+169], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -5.5e-26], t$95$1, If[LessEqual[z, 7.2e-111], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00135], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(-z\right) \cdot \left(t - z\right)}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+169}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-111}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;z \leq 0.00135:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.5999999999999999e169Initial program 67.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6493.7
Applied rewrites93.7%
if -4.5999999999999999e169 < z < -5.5000000000000005e-26 or 0.0013500000000000001 < z Initial program 88.3%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6480.3
Applied rewrites80.3%
if -5.5000000000000005e-26 < z < 7.20000000000000019e-111Initial program 96.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6481.0
Applied rewrites81.0%
if 7.20000000000000019e-111 < z < 0.0013500000000000001Initial program 99.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6477.8
Applied rewrites77.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.7e+101) (not (<= z 4.7e+101))) (/ (/ (- x) z) (- t z)) (/ x (* (- y z) (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.7e+101) || !(z <= 4.7e+101)) {
tmp = (-x / z) / (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 ((z <= (-2.7d+101)) .or. (.not. (z <= 4.7d+101))) then
tmp = (-x / z) / (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 ((z <= -2.7e+101) || !(z <= 4.7e+101)) {
tmp = (-x / z) / (t - z);
} else {
tmp = x / ((y - z) * (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.7e+101) or not (z <= 4.7e+101): tmp = (-x / z) / (t - z) else: tmp = x / ((y - z) * (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.7e+101) || !(z <= 4.7e+101)) tmp = Float64(Float64(Float64(-x) / z) / 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 ((z <= -2.7e+101) || ~((z <= 4.7e+101))) tmp = (-x / z) / (t - z); else tmp = x / ((y - z) * (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.7e+101], N[Not[LessEqual[z, 4.7e+101]], $MachinePrecision]], N[(N[((-x) / z), $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}\;z \leq -2.7 \cdot 10^{+101} \lor \neg \left(z \leq 4.7 \cdot 10^{+101}\right):\\
\;\;\;\;\frac{\frac{-x}{z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\end{array}
\end{array}
if z < -2.70000000000000006e101 or 4.69999999999999971e101 < z Initial program 78.8%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-fracN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower--.f6489.8
Applied rewrites89.8%
if -2.70000000000000006e101 < z < 4.69999999999999971e101Initial program 95.7%
Final simplification93.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* (- z) (- t z)))))
(if (<= z -5.5e-26)
t_1
(if (<= z 7.2e-111)
(/ x (* (- t z) y))
(if (<= z 0.00135) (/ x (* (- y z) t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (-z * (t - z));
double tmp;
if (z <= -5.5e-26) {
tmp = t_1;
} else if (z <= 7.2e-111) {
tmp = x / ((t - z) * y);
} else if (z <= 0.00135) {
tmp = x / ((y - 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 / (-z * (t - z))
if (z <= (-5.5d-26)) then
tmp = t_1
else if (z <= 7.2d-111) then
tmp = x / ((t - z) * y)
else if (z <= 0.00135d0) then
tmp = x / ((y - 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 / (-z * (t - z));
double tmp;
if (z <= -5.5e-26) {
tmp = t_1;
} else if (z <= 7.2e-111) {
tmp = x / ((t - z) * y);
} else if (z <= 0.00135) {
tmp = x / ((y - z) * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (-z * (t - z)) tmp = 0 if z <= -5.5e-26: tmp = t_1 elif z <= 7.2e-111: tmp = x / ((t - z) * y) elif z <= 0.00135: tmp = x / ((y - z) * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(-z) * Float64(t - z))) tmp = 0.0 if (z <= -5.5e-26) tmp = t_1; elseif (z <= 7.2e-111) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (z <= 0.00135) tmp = Float64(x / Float64(Float64(y - z) * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (-z * (t - z)); tmp = 0.0; if (z <= -5.5e-26) tmp = t_1; elseif (z <= 7.2e-111) tmp = x / ((t - z) * y); elseif (z <= 0.00135) tmp = x / ((y - z) * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[((-z) * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e-26], t$95$1, If[LessEqual[z, 7.2e-111], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00135], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(-z\right) \cdot \left(t - z\right)}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-111}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;z \leq 0.00135:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.5000000000000005e-26 or 0.0013500000000000001 < z Initial program 83.7%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6477.4
Applied rewrites77.4%
if -5.5000000000000005e-26 < z < 7.20000000000000019e-111Initial program 96.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6481.0
Applied rewrites81.0%
if 7.20000000000000019e-111 < z < 0.0013500000000000001Initial program 99.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6477.8
Applied rewrites77.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* (- z) (- y z)))))
(if (<= z -6.5e-108)
t_1
(if (<= z 7.2e-111)
(/ x (* (- t z) y))
(if (<= z 220000000000.0) (/ x (* (- y z) t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (-z * (y - z));
double tmp;
if (z <= -6.5e-108) {
tmp = t_1;
} else if (z <= 7.2e-111) {
tmp = x / ((t - z) * y);
} else if (z <= 220000000000.0) {
tmp = x / ((y - 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 / (-z * (y - z))
if (z <= (-6.5d-108)) then
tmp = t_1
else if (z <= 7.2d-111) then
tmp = x / ((t - z) * y)
else if (z <= 220000000000.0d0) then
tmp = x / ((y - 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 / (-z * (y - z));
double tmp;
if (z <= -6.5e-108) {
tmp = t_1;
} else if (z <= 7.2e-111) {
tmp = x / ((t - z) * y);
} else if (z <= 220000000000.0) {
tmp = x / ((y - z) * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (-z * (y - z)) tmp = 0 if z <= -6.5e-108: tmp = t_1 elif z <= 7.2e-111: tmp = x / ((t - z) * y) elif z <= 220000000000.0: tmp = x / ((y - z) * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(-z) * Float64(y - z))) tmp = 0.0 if (z <= -6.5e-108) tmp = t_1; elseif (z <= 7.2e-111) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (z <= 220000000000.0) tmp = Float64(x / Float64(Float64(y - z) * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (-z * (y - z)); tmp = 0.0; if (z <= -6.5e-108) tmp = t_1; elseif (z <= 7.2e-111) tmp = x / ((t - z) * y); elseif (z <= 220000000000.0) tmp = x / ((y - z) * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[((-z) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.5e-108], t$95$1, If[LessEqual[z, 7.2e-111], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 220000000000.0], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(-z\right) \cdot \left(y - z\right)}\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-111}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;z \leq 220000000000:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.5000000000000002e-108 or 2.2e11 < z Initial program 83.7%
Taylor expanded in t around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f6473.8
Applied rewrites73.8%
if -6.5000000000000002e-108 < z < 7.20000000000000019e-111Initial program 96.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6484.1
Applied rewrites84.1%
if 7.20000000000000019e-111 < z < 2.2e11Initial program 99.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6478.2
Applied rewrites78.2%
(FPCore (x y z t) :precision binary64 (if (<= z -2.7e+101) (/ (/ x (- t z)) (- z)) (if (<= z 4.7e+101) (/ x (* (- y z) (- t z))) (/ (/ (- x) z) (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.7e+101) {
tmp = (x / (t - z)) / -z;
} else if (z <= 4.7e+101) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (-x / 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 (z <= (-2.7d+101)) then
tmp = (x / (t - z)) / -z
else if (z <= 4.7d+101) then
tmp = x / ((y - z) * (t - z))
else
tmp = (-x / z) / (t - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.7e+101) {
tmp = (x / (t - z)) / -z;
} else if (z <= 4.7e+101) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (-x / z) / (t - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.7e+101: tmp = (x / (t - z)) / -z elif z <= 4.7e+101: tmp = x / ((y - z) * (t - z)) else: tmp = (-x / z) / (t - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.7e+101) tmp = Float64(Float64(x / Float64(t - z)) / Float64(-z)); elseif (z <= 4.7e+101) tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(Float64(-x) / z) / Float64(t - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.7e+101) tmp = (x / (t - z)) / -z; elseif (z <= 4.7e+101) tmp = x / ((y - z) * (t - z)); else tmp = (-x / z) / (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.7e+101], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, 4.7e+101], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+101}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{-z}\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{+101}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-x}{z}}{t - z}\\
\end{array}
\end{array}
if z < -2.70000000000000006e101Initial program 72.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6486.8
Applied rewrites86.8%
if -2.70000000000000006e101 < z < 4.69999999999999971e101Initial program 95.7%
if 4.69999999999999971e101 < z Initial program 86.3%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-fracN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower--.f6493.2
Applied rewrites93.2%
Final simplification93.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* z z))))
(if (<= z -2.95e-7)
t_1
(if (<= z 7.2e-111)
(/ x (* (- t z) y))
(if (<= z 4.6e+34) (/ x (* (- y z) t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -2.95e-7) {
tmp = t_1;
} else if (z <= 7.2e-111) {
tmp = x / ((t - z) * y);
} else if (z <= 4.6e+34) {
tmp = x / ((y - 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 / (z * z)
if (z <= (-2.95d-7)) then
tmp = t_1
else if (z <= 7.2d-111) then
tmp = x / ((t - z) * y)
else if (z <= 4.6d+34) then
tmp = x / ((y - 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 / (z * z);
double tmp;
if (z <= -2.95e-7) {
tmp = t_1;
} else if (z <= 7.2e-111) {
tmp = x / ((t - z) * y);
} else if (z <= 4.6e+34) {
tmp = x / ((y - z) * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * z) tmp = 0 if z <= -2.95e-7: tmp = t_1 elif z <= 7.2e-111: tmp = x / ((t - z) * y) elif z <= 4.6e+34: tmp = x / ((y - z) * 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.95e-7) tmp = t_1; elseif (z <= 7.2e-111) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (z <= 4.6e+34) tmp = Float64(x / Float64(Float64(y - z) * 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.95e-7) tmp = t_1; elseif (z <= 7.2e-111) tmp = x / ((t - z) * y); elseif (z <= 4.6e+34) tmp = x / ((y - z) * 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.95e-7], t$95$1, If[LessEqual[z, 7.2e-111], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.6e+34], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot z}\\
\mathbf{if}\;z \leq -2.95 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-111}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+34}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.94999999999999981e-7 or 4.5999999999999996e34 < z Initial program 81.9%
Taylor expanded in z around inf
unpow2N/A
lower-*.f6472.0
Applied rewrites72.0%
if -2.94999999999999981e-7 < z < 7.20000000000000019e-111Initial program 96.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6478.9
Applied rewrites78.9%
if 7.20000000000000019e-111 < z < 4.5999999999999996e34Initial program 99.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6472.0
Applied rewrites72.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* z z))))
(if (<= z -1.15e-7)
t_1
(if (<= z -4.7e-116)
(/ (- x) (* y z))
(if (<= z 980000000000.0) (/ 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 <= -1.15e-7) {
tmp = t_1;
} else if (z <= -4.7e-116) {
tmp = -x / (y * z);
} else if (z <= 980000000000.0) {
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 <= (-1.15d-7)) then
tmp = t_1
else if (z <= (-4.7d-116)) then
tmp = -x / (y * z)
else if (z <= 980000000000.0d0) 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 <= -1.15e-7) {
tmp = t_1;
} else if (z <= -4.7e-116) {
tmp = -x / (y * z);
} else if (z <= 980000000000.0) {
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 <= -1.15e-7: tmp = t_1 elif z <= -4.7e-116: tmp = -x / (y * z) elif z <= 980000000000.0: 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 <= -1.15e-7) tmp = t_1; elseif (z <= -4.7e-116) tmp = Float64(Float64(-x) / Float64(y * z)); elseif (z <= 980000000000.0) 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 <= -1.15e-7) tmp = t_1; elseif (z <= -4.7e-116) tmp = -x / (y * z); elseif (z <= 980000000000.0) 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, -1.15e-7], t$95$1, If[LessEqual[z, -4.7e-116], N[((-x) / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 980000000000.0], 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 -1.15 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-116}:\\
\;\;\;\;\frac{-x}{y \cdot z}\\
\mathbf{elif}\;z \leq 980000000000:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.14999999999999997e-7 or 9.8e11 < z Initial program 82.6%
Taylor expanded in z around inf
unpow2N/A
lower-*.f6470.1
Applied rewrites70.1%
if -1.14999999999999997e-7 < z < -4.69999999999999994e-116Initial program 93.7%
Taylor expanded in y around inf
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f6452.2
Applied rewrites52.2%
Taylor expanded in z around inf
Applied rewrites33.5%
Applied rewrites33.5%
if -4.69999999999999994e-116 < z < 9.8e11Initial program 97.2%
Taylor expanded in z around 0
lower-*.f6469.9
Applied rewrites69.9%
Final simplification67.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.95e-7) (not (<= z 1.55e+36))) (/ x (* z z)) (/ x (* (- t z) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.95e-7) || !(z <= 1.55e+36)) {
tmp = x / (z * z);
} else {
tmp = x / ((t - z) * 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 <= (-2.95d-7)) .or. (.not. (z <= 1.55d+36))) then
tmp = x / (z * z)
else
tmp = x / ((t - z) * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.95e-7) || !(z <= 1.55e+36)) {
tmp = x / (z * z);
} else {
tmp = x / ((t - z) * y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.95e-7) or not (z <= 1.55e+36): tmp = x / (z * z) else: tmp = x / ((t - z) * y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.95e-7) || !(z <= 1.55e+36)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(x / Float64(Float64(t - z) * y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.95e-7) || ~((z <= 1.55e+36))) tmp = x / (z * z); else tmp = x / ((t - z) * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.95e-7], N[Not[LessEqual[z, 1.55e+36]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.95 \cdot 10^{-7} \lor \neg \left(z \leq 1.55 \cdot 10^{+36}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\end{array}
\end{array}
if z < -2.94999999999999981e-7 or 1.55e36 < z Initial program 81.9%
Taylor expanded in z around inf
unpow2N/A
lower-*.f6472.0
Applied rewrites72.0%
if -2.94999999999999981e-7 < z < 1.55e36Initial program 96.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6475.3
Applied rewrites75.3%
Final simplification73.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.55e-8) (not (<= z 980000000000.0))) (/ x (* z z)) (/ x (* t y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.55e-8) || !(z <= 980000000000.0)) {
tmp = x / (z * z);
} else {
tmp = x / (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 <= (-1.55d-8)) .or. (.not. (z <= 980000000000.0d0))) then
tmp = x / (z * z)
else
tmp = x / (t * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.55e-8) || !(z <= 980000000000.0)) {
tmp = x / (z * z);
} else {
tmp = x / (t * y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.55e-8) or not (z <= 980000000000.0): tmp = x / (z * z) else: tmp = x / (t * y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.55e-8) || !(z <= 980000000000.0)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(x / Float64(t * y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.55e-8) || ~((z <= 980000000000.0))) tmp = x / (z * z); else tmp = x / (t * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.55e-8], N[Not[LessEqual[z, 980000000000.0]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-8} \lor \neg \left(z \leq 980000000000\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -1.55e-8 or 9.8e11 < z Initial program 82.6%
Taylor expanded in z around inf
unpow2N/A
lower-*.f6470.1
Applied rewrites70.1%
if -1.55e-8 < z < 9.8e11Initial program 96.8%
Taylor expanded in z around 0
lower-*.f6465.3
Applied rewrites65.3%
Final simplification67.8%
(FPCore (x y z t) :precision binary64 (if (<= z -4.6e+169) (/ (/ x z) z) (/ x (* (- y z) (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.6e+169) {
tmp = (x / z) / 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 (z <= (-4.6d+169)) then
tmp = (x / z) / 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 (z <= -4.6e+169) {
tmp = (x / z) / z;
} else {
tmp = x / ((y - z) * (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.6e+169: tmp = (x / z) / z else: tmp = x / ((y - z) * (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.6e+169) tmp = Float64(Float64(x / z) / 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 (z <= -4.6e+169) tmp = (x / z) / z; else tmp = x / ((y - z) * (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.6e+169], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+169}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\end{array}
\end{array}
if z < -4.5999999999999999e169Initial program 67.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6493.7
Applied rewrites93.7%
if -4.5999999999999999e169 < z Initial program 92.6%
(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.5%
Taylor expanded in z around 0
lower-*.f6443.1
Applied rewrites43.1%
(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 2024337
(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))))