
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Initial program 99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (<= y -3.1e-60) 1.0 (if (<= y 2.75e-34) (+ 1.0 (/ (/ x t) (- y z))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e-60) {
tmp = 1.0;
} else if (y <= 2.75e-34) {
tmp = 1.0 + ((x / t) / (y - z));
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.1d-60)) then
tmp = 1.0d0
else if (y <= 2.75d-34) then
tmp = 1.0d0 + ((x / t) / (y - z))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e-60) {
tmp = 1.0;
} else if (y <= 2.75e-34) {
tmp = 1.0 + ((x / t) / (y - z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.1e-60: tmp = 1.0 elif y <= 2.75e-34: tmp = 1.0 + ((x / t) / (y - z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.1e-60) tmp = 1.0; elseif (y <= 2.75e-34) tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.1e-60) tmp = 1.0; elseif (y <= 2.75e-34) tmp = 1.0 + ((x / t) / (y - z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.1e-60], 1.0, If[LessEqual[y, 2.75e-34], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-60}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.75 \cdot 10^{-34}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.09999999999999988e-60 or 2.75000000000000007e-34 < y Initial program 99.9%
Taylor expanded in z around 0 93.5%
Taylor expanded in y around 0 70.8%
mul-1-neg70.8%
associate-/r*70.7%
distribute-neg-frac70.7%
distribute-frac-neg70.7%
Simplified70.7%
expm1-log1p-u69.4%
expm1-udef69.4%
associate-/l/69.4%
add-sqr-sqrt30.2%
sqrt-unprod59.3%
sqr-neg59.3%
sqrt-unprod39.4%
add-sqr-sqrt68.6%
Applied egg-rr68.6%
expm1-def68.6%
expm1-log1p69.3%
Simplified69.3%
Taylor expanded in x around 0 89.0%
if -3.09999999999999988e-60 < y < 2.75000000000000007e-34Initial program 98.6%
sub-neg98.6%
distribute-frac-neg98.6%
*-lft-identity98.6%
associate-/r*96.5%
associate-*r/96.5%
metadata-eval96.5%
times-frac96.5%
neg-mul-196.5%
remove-double-neg96.5%
neg-mul-196.5%
sub-neg96.5%
distribute-neg-out96.5%
remove-double-neg96.5%
+-commutative96.5%
sub-neg96.5%
Simplified96.5%
Taylor expanded in x around 0 98.6%
associate-/r*98.9%
Simplified98.9%
Taylor expanded in t around inf 88.0%
mul-1-neg88.0%
associate-/r*88.4%
distribute-neg-frac88.4%
distribute-frac-neg88.4%
Simplified88.4%
frac-2neg88.4%
div-inv88.4%
distribute-frac-neg88.4%
remove-double-neg88.4%
sub-neg88.4%
distribute-neg-in88.4%
add-sqr-sqrt45.7%
sqrt-unprod82.4%
sqr-neg82.4%
sqrt-unprod38.4%
add-sqr-sqrt77.8%
add-sqr-sqrt39.4%
sqrt-unprod80.5%
sqr-neg80.5%
sqrt-unprod42.8%
add-sqr-sqrt88.4%
Applied egg-rr88.4%
associate-*r/88.4%
*-rgt-identity88.4%
+-commutative88.4%
unsub-neg88.4%
Simplified88.4%
Final simplification88.7%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.28e-145)
(+ 1.0 (/ (/ x (- y t)) z))
(if (<= z 1.1e-294)
(- 1.0 (/ x (* y (- y t))))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.28e-145) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (z <= 1.1e-294) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.28d-145)) then
tmp = 1.0d0 + ((x / (y - t)) / z)
else if (z <= 1.1d-294) then
tmp = 1.0d0 - (x / (y * (y - t)))
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.28e-145) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (z <= 1.1e-294) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.28e-145: tmp = 1.0 + ((x / (y - t)) / z) elif z <= 1.1e-294: tmp = 1.0 - (x / (y * (y - t))) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.28e-145) tmp = Float64(1.0 + Float64(Float64(x / Float64(y - t)) / z)); elseif (z <= 1.1e-294) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.28e-145) tmp = 1.0 + ((x / (y - t)) / z); elseif (z <= 1.1e-294) tmp = 1.0 - (x / (y * (y - t))); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.28e-145], N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-294], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.28 \cdot 10^{-145}:\\
\;\;\;\;1 + \frac{\frac{x}{y - t}}{z}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-294}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if z < -1.28e-145Initial program 98.3%
sub-neg98.3%
distribute-frac-neg98.3%
*-lft-identity98.3%
associate-/r*98.9%
associate-*r/98.9%
metadata-eval98.9%
times-frac98.9%
neg-mul-198.9%
remove-double-neg98.9%
neg-mul-198.9%
sub-neg98.9%
distribute-neg-out98.9%
remove-double-neg98.9%
+-commutative98.9%
sub-neg98.9%
Simplified98.9%
Taylor expanded in z around inf 87.8%
*-commutative87.8%
associate-/r*88.2%
Simplified88.2%
if -1.28e-145 < z < 1.1e-294Initial program 99.9%
Taylor expanded in z around 0 99.4%
if 1.1e-294 < z Initial program 99.9%
sub-neg99.9%
distribute-frac-neg99.9%
*-lft-identity99.9%
associate-/r*97.8%
associate-*r/97.8%
metadata-eval97.8%
times-frac97.8%
neg-mul-197.8%
remove-double-neg97.8%
neg-mul-197.8%
sub-neg97.8%
distribute-neg-out97.8%
remove-double-neg97.8%
+-commutative97.8%
sub-neg97.8%
Simplified97.8%
Taylor expanded in x around 0 99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in t around inf 85.7%
mul-1-neg85.7%
associate-/r*85.6%
distribute-neg-frac85.6%
distribute-frac-neg85.6%
Simplified85.6%
frac-2neg85.6%
div-inv85.6%
distribute-frac-neg85.6%
remove-double-neg85.6%
sub-neg85.6%
distribute-neg-in85.6%
add-sqr-sqrt36.3%
sqrt-unprod81.6%
sqr-neg81.6%
sqrt-unprod46.0%
add-sqr-sqrt79.3%
add-sqr-sqrt33.3%
sqrt-unprod81.9%
sqr-neg81.9%
sqrt-unprod49.4%
add-sqr-sqrt85.6%
Applied egg-rr85.6%
associate-*r/85.6%
*-rgt-identity85.6%
+-commutative85.6%
unsub-neg85.6%
Simplified85.6%
Final simplification88.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.28e-145)
(+ 1.0 (/ (/ x (- y t)) z))
(if (<= z 9.5e-295)
(- 1.0 (/ (/ x y) (- y t)))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.28e-145) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (z <= 9.5e-295) {
tmp = 1.0 - ((x / y) / (y - t));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.28d-145)) then
tmp = 1.0d0 + ((x / (y - t)) / z)
else if (z <= 9.5d-295) then
tmp = 1.0d0 - ((x / y) / (y - t))
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.28e-145) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (z <= 9.5e-295) {
tmp = 1.0 - ((x / y) / (y - t));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.28e-145: tmp = 1.0 + ((x / (y - t)) / z) elif z <= 9.5e-295: tmp = 1.0 - ((x / y) / (y - t)) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.28e-145) tmp = Float64(1.0 + Float64(Float64(x / Float64(y - t)) / z)); elseif (z <= 9.5e-295) tmp = Float64(1.0 - Float64(Float64(x / y) / Float64(y - t))); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.28e-145) tmp = 1.0 + ((x / (y - t)) / z); elseif (z <= 9.5e-295) tmp = 1.0 - ((x / y) / (y - t)); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.28e-145], N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-295], N[(1.0 - N[(N[(x / y), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.28 \cdot 10^{-145}:\\
\;\;\;\;1 + \frac{\frac{x}{y - t}}{z}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-295}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if z < -1.28e-145Initial program 98.3%
sub-neg98.3%
distribute-frac-neg98.3%
*-lft-identity98.3%
associate-/r*98.9%
associate-*r/98.9%
metadata-eval98.9%
times-frac98.9%
neg-mul-198.9%
remove-double-neg98.9%
neg-mul-198.9%
sub-neg98.9%
distribute-neg-out98.9%
remove-double-neg98.9%
+-commutative98.9%
sub-neg98.9%
Simplified98.9%
Taylor expanded in z around inf 87.8%
*-commutative87.8%
associate-/r*88.2%
Simplified88.2%
if -1.28e-145 < z < 9.5e-295Initial program 99.9%
Taylor expanded in z around 0 99.4%
associate-/r*99.4%
Simplified99.4%
if 9.5e-295 < z Initial program 99.9%
sub-neg99.9%
distribute-frac-neg99.9%
*-lft-identity99.9%
associate-/r*97.8%
associate-*r/97.8%
metadata-eval97.8%
times-frac97.8%
neg-mul-197.8%
remove-double-neg97.8%
neg-mul-197.8%
sub-neg97.8%
distribute-neg-out97.8%
remove-double-neg97.8%
+-commutative97.8%
sub-neg97.8%
Simplified97.8%
Taylor expanded in x around 0 99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in t around inf 85.7%
mul-1-neg85.7%
associate-/r*85.6%
distribute-neg-frac85.6%
distribute-frac-neg85.6%
Simplified85.6%
frac-2neg85.6%
div-inv85.6%
distribute-frac-neg85.6%
remove-double-neg85.6%
sub-neg85.6%
distribute-neg-in85.6%
add-sqr-sqrt36.3%
sqrt-unprod81.6%
sqr-neg81.6%
sqrt-unprod46.0%
add-sqr-sqrt79.3%
add-sqr-sqrt33.3%
sqrt-unprod81.9%
sqr-neg81.9%
sqrt-unprod49.4%
add-sqr-sqrt85.6%
Applied egg-rr85.6%
associate-*r/85.6%
*-rgt-identity85.6%
+-commutative85.6%
unsub-neg85.6%
Simplified85.6%
Final simplification88.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.7e-143)
(+ 1.0 (/ (/ x (- y t)) z))
(if (<= z 1.1e-294)
(- 1.0 (/ (/ x y) (- y t)))
(+ 1.0 (/ x (* (- y z) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.7e-143) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (z <= 1.1e-294) {
tmp = 1.0 - ((x / y) / (y - t));
} else {
tmp = 1.0 + (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 (z <= (-1.7d-143)) then
tmp = 1.0d0 + ((x / (y - t)) / z)
else if (z <= 1.1d-294) then
tmp = 1.0d0 - ((x / y) / (y - t))
else
tmp = 1.0d0 + (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 (z <= -1.7e-143) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (z <= 1.1e-294) {
tmp = 1.0 - ((x / y) / (y - t));
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.7e-143: tmp = 1.0 + ((x / (y - t)) / z) elif z <= 1.1e-294: tmp = 1.0 - ((x / y) / (y - t)) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.7e-143) tmp = Float64(1.0 + Float64(Float64(x / Float64(y - t)) / z)); elseif (z <= 1.1e-294) tmp = Float64(1.0 - Float64(Float64(x / y) / Float64(y - t))); else tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.7e-143) tmp = 1.0 + ((x / (y - t)) / z); elseif (z <= 1.1e-294) tmp = 1.0 - ((x / y) / (y - t)); else tmp = 1.0 + (x / ((y - z) * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.7e-143], N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-294], N[(1.0 - N[(N[(x / y), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-143}:\\
\;\;\;\;1 + \frac{\frac{x}{y - t}}{z}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-294}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if z < -1.69999999999999992e-143Initial program 98.3%
sub-neg98.3%
distribute-frac-neg98.3%
*-lft-identity98.3%
associate-/r*98.9%
associate-*r/98.9%
metadata-eval98.9%
times-frac98.9%
neg-mul-198.9%
remove-double-neg98.9%
neg-mul-198.9%
sub-neg98.9%
distribute-neg-out98.9%
remove-double-neg98.9%
+-commutative98.9%
sub-neg98.9%
Simplified98.9%
Taylor expanded in z around inf 87.8%
*-commutative87.8%
associate-/r*88.2%
Simplified88.2%
if -1.69999999999999992e-143 < z < 1.1e-294Initial program 99.9%
Taylor expanded in z around 0 99.4%
associate-/r*99.4%
Simplified99.4%
if 1.1e-294 < z Initial program 99.9%
Taylor expanded in t around inf 85.7%
associate-*r/85.7%
neg-mul-185.7%
Simplified85.7%
Final simplification88.2%
(FPCore (x y z t) :precision binary64 (if (<= t -1.18e-89) 1.0 (if (<= t 1.55e-130) (+ 1.0 (/ x (* y z))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.18e-89) {
tmp = 1.0;
} else if (t <= 1.55e-130) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.18d-89)) then
tmp = 1.0d0
else if (t <= 1.55d-130) then
tmp = 1.0d0 + (x / (y * z))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.18e-89) {
tmp = 1.0;
} else if (t <= 1.55e-130) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.18e-89: tmp = 1.0 elif t <= 1.55e-130: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.18e-89) tmp = 1.0; elseif (t <= 1.55e-130) tmp = Float64(1.0 + Float64(x / Float64(y * z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.18e-89) tmp = 1.0; elseif (t <= 1.55e-130) tmp = 1.0 + (x / (y * z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.18e-89], 1.0, If[LessEqual[t, 1.55e-130], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.18 \cdot 10^{-89}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-130}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -1.18000000000000001e-89 or 1.55000000000000005e-130 < t Initial program 99.9%
Taylor expanded in z around 0 73.4%
Taylor expanded in y around 0 66.5%
mul-1-neg66.5%
associate-/r*66.5%
distribute-neg-frac66.5%
distribute-frac-neg66.5%
Simplified66.5%
expm1-log1p-u61.7%
expm1-udef61.7%
associate-/l/61.7%
add-sqr-sqrt26.6%
sqrt-unprod53.2%
sqr-neg53.2%
sqrt-unprod35.6%
add-sqr-sqrt61.4%
Applied egg-rr61.4%
expm1-def61.4%
expm1-log1p62.3%
Simplified62.3%
Taylor expanded in x around 0 82.4%
if -1.18000000000000001e-89 < t < 1.55000000000000005e-130Initial program 98.2%
sub-neg98.2%
distribute-frac-neg98.2%
*-lft-identity98.2%
associate-/r*99.9%
associate-*r/99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub-neg99.9%
distribute-neg-out99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 80.0%
*-commutative80.0%
associate-/r*81.8%
Simplified81.8%
Taylor expanded in y around inf 74.6%
*-commutative74.6%
Simplified74.6%
Final simplification80.0%
(FPCore (x y z t) :precision binary64 (if (<= y -9.8e-107) 1.0 (if (<= y 5.4e-39) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.8e-107) {
tmp = 1.0;
} else if (y <= 5.4e-39) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-9.8d-107)) then
tmp = 1.0d0
else if (y <= 5.4d-39) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.8e-107) {
tmp = 1.0;
} else if (y <= 5.4e-39) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9.8e-107: tmp = 1.0 elif y <= 5.4e-39: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9.8e-107) tmp = 1.0; elseif (y <= 5.4e-39) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9.8e-107) tmp = 1.0; elseif (y <= 5.4e-39) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9.8e-107], 1.0, If[LessEqual[y, 5.4e-39], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.8 \cdot 10^{-107}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-39}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -9.79999999999999959e-107 or 5.4000000000000001e-39 < y Initial program 99.9%
Taylor expanded in z around 0 92.5%
Taylor expanded in y around 0 70.2%
mul-1-neg70.2%
associate-/r*70.1%
distribute-neg-frac70.1%
distribute-frac-neg70.1%
Simplified70.1%
expm1-log1p-u67.5%
expm1-udef67.5%
associate-/l/67.5%
add-sqr-sqrt29.5%
sqrt-unprod57.9%
sqr-neg57.9%
sqrt-unprod38.3%
add-sqr-sqrt66.8%
Applied egg-rr66.8%
expm1-def66.8%
expm1-log1p67.5%
Simplified67.5%
Taylor expanded in x around 0 87.6%
if -9.79999999999999959e-107 < y < 5.4000000000000001e-39Initial program 98.5%
Taylor expanded in y around 0 79.1%
Final simplification84.2%
(FPCore (x y z t) :precision binary64 (if (<= y -2e-106) 1.0 (if (<= y 1.85e-37) (- 1.0 (/ (/ x t) z)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2e-106) {
tmp = 1.0;
} else if (y <= 1.85e-37) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2d-106)) then
tmp = 1.0d0
else if (y <= 1.85d-37) then
tmp = 1.0d0 - ((x / t) / z)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2e-106) {
tmp = 1.0;
} else if (y <= 1.85e-37) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2e-106: tmp = 1.0 elif y <= 1.85e-37: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2e-106) tmp = 1.0; elseif (y <= 1.85e-37) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2e-106) tmp = 1.0; elseif (y <= 1.85e-37) tmp = 1.0 - ((x / t) / z); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2e-106], 1.0, If[LessEqual[y, 1.85e-37], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-106}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{-37}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.99999999999999988e-106 or 1.85e-37 < y Initial program 99.9%
Taylor expanded in z around 0 92.5%
Taylor expanded in y around 0 70.2%
mul-1-neg70.2%
associate-/r*70.1%
distribute-neg-frac70.1%
distribute-frac-neg70.1%
Simplified70.1%
expm1-log1p-u67.5%
expm1-udef67.5%
associate-/l/67.5%
add-sqr-sqrt29.5%
sqrt-unprod57.9%
sqr-neg57.9%
sqrt-unprod38.3%
add-sqr-sqrt66.8%
Applied egg-rr66.8%
expm1-def66.8%
expm1-log1p67.5%
Simplified67.5%
Taylor expanded in x around 0 87.6%
if -1.99999999999999988e-106 < y < 1.85e-37Initial program 98.5%
Taylor expanded in y around 0 79.1%
*-un-lft-identity79.1%
times-frac78.6%
Applied egg-rr78.6%
associate-*l/78.6%
*-lft-identity78.6%
Simplified78.6%
Taylor expanded in x around 0 79.1%
associate-/r*79.5%
Simplified79.5%
Final simplification84.3%
(FPCore (x y z t) :precision binary64 (if (<= t 8.2e-50) (+ 1.0 (/ (/ x (- y t)) z)) (+ 1.0 (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 8.2e-50) {
tmp = 1.0 + ((x / (y - t)) / z);
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 8.2d-50) then
tmp = 1.0d0 + ((x / (y - t)) / z)
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 8.2e-50) {
tmp = 1.0 + ((x / (y - t)) / z);
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 8.2e-50: tmp = 1.0 + ((x / (y - t)) / z) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 8.2e-50) tmp = Float64(1.0 + Float64(Float64(x / Float64(y - t)) / z)); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 8.2e-50) tmp = 1.0 + ((x / (y - t)) / z); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 8.2e-50], N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 8.2 \cdot 10^{-50}:\\
\;\;\;\;1 + \frac{\frac{x}{y - t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 8.19999999999999971e-50Initial program 99.2%
sub-neg99.2%
distribute-frac-neg99.2%
*-lft-identity99.2%
associate-/r*99.5%
associate-*r/99.5%
metadata-eval99.5%
times-frac99.5%
neg-mul-199.5%
remove-double-neg99.5%
neg-mul-199.5%
sub-neg99.5%
distribute-neg-out99.5%
remove-double-neg99.5%
+-commutative99.5%
sub-neg99.5%
Simplified99.5%
Taylor expanded in z around inf 80.3%
*-commutative80.3%
associate-/r*80.6%
Simplified80.6%
if 8.19999999999999971e-50 < t Initial program 99.9%
sub-neg99.9%
distribute-frac-neg99.9%
*-lft-identity99.9%
associate-/r*95.5%
associate-*r/95.5%
metadata-eval95.5%
times-frac95.5%
neg-mul-195.5%
remove-double-neg95.5%
neg-mul-195.5%
sub-neg95.5%
distribute-neg-out95.5%
remove-double-neg95.5%
+-commutative95.5%
sub-neg95.5%
Simplified95.5%
Taylor expanded in x around 0 99.9%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in t around inf 98.4%
mul-1-neg98.4%
associate-/r*98.3%
distribute-neg-frac98.3%
distribute-frac-neg98.3%
Simplified98.3%
frac-2neg98.3%
div-inv98.4%
distribute-frac-neg98.4%
remove-double-neg98.4%
sub-neg98.4%
distribute-neg-in98.4%
add-sqr-sqrt50.7%
sqrt-unprod94.4%
sqr-neg94.4%
sqrt-unprod45.1%
add-sqr-sqrt91.2%
add-sqr-sqrt46.2%
sqrt-unprod92.4%
sqr-neg92.4%
sqrt-unprod47.7%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
associate-*r/98.3%
*-rgt-identity98.3%
+-commutative98.3%
unsub-neg98.3%
Simplified98.3%
Final simplification85.1%
(FPCore (x y z t) :precision binary64 (+ 1.0 (/ (/ x (- y t)) (- z y))))
double code(double x, double y, double z, double t) {
return 1.0 + ((x / (y - t)) / (z - y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + ((x / (y - t)) / (z - y))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + ((x / (y - t)) / (z - y));
}
def code(x, y, z, t): return 1.0 + ((x / (y - t)) / (z - y))
function code(x, y, z, t) return Float64(1.0 + Float64(Float64(x / Float64(y - t)) / Float64(z - y))) end
function tmp = code(x, y, z, t) tmp = 1.0 + ((x / (y - t)) / (z - y)); end
code[x_, y_, z_, t_] := N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{\frac{x}{y - t}}{z - y}
\end{array}
Initial program 99.4%
sub-neg99.4%
distribute-frac-neg99.4%
*-lft-identity99.4%
associate-/r*98.5%
associate-*r/98.5%
metadata-eval98.5%
times-frac98.5%
neg-mul-198.5%
remove-double-neg98.5%
neg-mul-198.5%
sub-neg98.5%
distribute-neg-out98.5%
remove-double-neg98.5%
+-commutative98.5%
sub-neg98.5%
Simplified98.5%
Taylor expanded in x around 0 99.4%
associate-/r*99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.4%
Taylor expanded in z around 0 70.7%
Taylor expanded in y around 0 57.0%
mul-1-neg57.0%
associate-/r*57.0%
distribute-neg-frac57.0%
distribute-frac-neg57.0%
Simplified57.0%
expm1-log1p-u51.0%
expm1-udef51.0%
associate-/l/51.0%
add-sqr-sqrt22.4%
sqrt-unprod45.9%
sqr-neg45.9%
sqrt-unprod27.9%
add-sqr-sqrt50.1%
Applied egg-rr50.1%
expm1-def50.1%
expm1-log1p52.2%
Simplified52.2%
Taylor expanded in x around 0 74.0%
Final simplification74.0%
herbie shell --seed 2024011
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A"
:precision binary64
(- 1.0 (/ x (* (- y z) (- y t)))))