
(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 17 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 (- y z)) (/ -1.0 (- z t))))
double code(double x, double y, double z, double t) {
return (x / (y - z)) * (-1.0 / (z - t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / (y - z)) * ((-1.0d0) / (z - t))
end function
public static double code(double x, double y, double z, double t) {
return (x / (y - z)) * (-1.0 / (z - t));
}
def code(x, y, z, t): return (x / (y - z)) * (-1.0 / (z - t))
function code(x, y, z, t) return Float64(Float64(x / Float64(y - z)) * Float64(-1.0 / Float64(z - t))) end
function tmp = code(x, y, z, t) tmp = (x / (y - z)) * (-1.0 / (z - t)); end
code[x_, y_, z_, t_] := N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y - z} \cdot \frac{-1}{z - t}
\end{array}
Initial program 88.2%
associate-/r*98.4%
div-inv98.3%
Applied egg-rr98.3%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) (- t z))))
(if (<= t_1 (- INFINITY))
(/ (/ x y) (- t z))
(if (<= t_1 5e+302) (/ x t_1) (/ (/ x (- z y)) z)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x / y) / (t - z);
} else if (t_1 <= 5e+302) {
tmp = x / t_1;
} else {
tmp = (x / (z - y)) / z;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (x / y) / (t - z);
} else if (t_1 <= 5e+302) {
tmp = x / t_1;
} else {
tmp = (x / (z - y)) / z;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if t_1 <= -math.inf: tmp = (x / y) / (t - z) elif t_1 <= 5e+302: tmp = x / t_1 else: tmp = (x / (z - y)) / z return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t_1 <= 5e+302) tmp = Float64(x / t_1); else tmp = Float64(Float64(x / Float64(z - y)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); tmp = 0.0; if (t_1 <= -Inf) tmp = (x / y) / (t - z); elseif (t_1 <= 5e+302) tmp = x / t_1; else tmp = (x / (z - y)) / z; 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[LessEqual[t$95$1, (-Infinity)], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+302], N[(x / t$95$1), $MachinePrecision], N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;\frac{x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z - y}}{z}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -inf.0Initial program 62.3%
Taylor expanded in y around inf 57.6%
associate-/r*81.6%
Simplified81.6%
if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < 5e302Initial program 98.5%
if 5e302 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 70.4%
associate-/r*99.9%
div-inv99.7%
Applied egg-rr99.7%
un-div-inv99.9%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in t around 0 62.0%
associate-*r/62.0%
times-frac85.7%
associate-*l/85.8%
mul-1-neg85.8%
Simplified85.8%
Final simplification93.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* z (- t)))))
(if (<= z -1.32e-117)
t_1
(if (<= z 1e-23) (/ (/ x t) y) (if (<= z 1.5e+123) t_1 (/ x (* y z)))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z * -t);
double tmp;
if (z <= -1.32e-117) {
tmp = t_1;
} else if (z <= 1e-23) {
tmp = (x / t) / y;
} else if (z <= 1.5e+123) {
tmp = t_1;
} else {
tmp = x / (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) :: t_1
real(8) :: tmp
t_1 = x / (z * -t)
if (z <= (-1.32d-117)) then
tmp = t_1
else if (z <= 1d-23) then
tmp = (x / t) / y
else if (z <= 1.5d+123) then
tmp = t_1
else
tmp = x / (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z * -t);
double tmp;
if (z <= -1.32e-117) {
tmp = t_1;
} else if (z <= 1e-23) {
tmp = (x / t) / y;
} else if (z <= 1.5e+123) {
tmp = t_1;
} else {
tmp = x / (y * z);
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * -t) tmp = 0 if z <= -1.32e-117: tmp = t_1 elif z <= 1e-23: tmp = (x / t) / y elif z <= 1.5e+123: tmp = t_1 else: tmp = x / (y * z) return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z * Float64(-t))) tmp = 0.0 if (z <= -1.32e-117) tmp = t_1; elseif (z <= 1e-23) tmp = Float64(Float64(x / t) / y); elseif (z <= 1.5e+123) tmp = t_1; else tmp = Float64(x / Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z * -t); tmp = 0.0; if (z <= -1.32e-117) tmp = t_1; elseif (z <= 1e-23) tmp = (x / t) / y; elseif (z <= 1.5e+123) tmp = t_1; else tmp = x / (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * (-t)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.32e-117], t$95$1, If[LessEqual[z, 1e-23], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1.5e+123], t$95$1, N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(-t\right)}\\
\mathbf{if}\;z \leq -1.32 \cdot 10^{-117}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{-23}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot z}\\
\end{array}
\end{array}
if z < -1.32e-117 or 9.9999999999999996e-24 < z < 1.50000000000000004e123Initial program 88.8%
associate-/l/99.0%
Simplified99.0%
Taylor expanded in t around inf 51.1%
Taylor expanded in y around 0 40.2%
associate-*r/40.2%
mul-1-neg40.2%
Simplified40.2%
if -1.32e-117 < z < 9.9999999999999996e-24Initial program 93.5%
Taylor expanded in z around 0 72.0%
associate-/r*73.5%
Simplified73.5%
if 1.50000000000000004e123 < z Initial program 72.3%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 91.8%
associate-*r/91.8%
neg-mul-191.8%
Simplified91.8%
div-inv91.8%
associate-/l*67.3%
add-sqr-sqrt23.5%
sqrt-unprod62.0%
sqr-neg62.0%
sqrt-unprod41.1%
add-sqr-sqrt64.7%
Applied egg-rr64.7%
associate-/r*64.9%
associate-*r/64.9%
associate-*l/64.9%
*-rgt-identity64.9%
Simplified64.9%
Taylor expanded in z around 0 34.8%
*-commutative34.8%
Simplified34.8%
Final simplification51.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8e+20) (not (<= z 4.6e-24))) (/ (/ x z) (- y)) (* (/ x y) (/ 1.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e+20) || !(z <= 4.6e-24)) {
tmp = (x / z) / -y;
} else {
tmp = (x / y) * (1.0 / 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 <= (-8d+20)) .or. (.not. (z <= 4.6d-24))) then
tmp = (x / z) / -y
else
tmp = (x / y) * (1.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e+20) || !(z <= 4.6e-24)) {
tmp = (x / z) / -y;
} else {
tmp = (x / y) * (1.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -8e+20) or not (z <= 4.6e-24): tmp = (x / z) / -y else: tmp = (x / y) * (1.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -8e+20) || !(z <= 4.6e-24)) tmp = Float64(Float64(x / z) / Float64(-y)); else tmp = Float64(Float64(x / y) * Float64(1.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -8e+20) || ~((z <= 4.6e-24))) tmp = (x / z) / -y; else tmp = (x / y) * (1.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8e+20], N[Not[LessEqual[z, 4.6e-24]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / (-y)), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+20} \lor \neg \left(z \leq 4.6 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{-y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{t}\\
\end{array}
\end{array}
if z < -8e20 or 4.6000000000000002e-24 < z Initial program 82.8%
Taylor expanded in t around 0 69.1%
associate-*r/69.1%
neg-mul-169.1%
Simplified69.1%
Taylor expanded in z around 0 35.8%
mul-1-neg35.8%
associate-/l/41.7%
distribute-neg-frac241.7%
Simplified41.7%
if -8e20 < z < 4.6000000000000002e-24Initial program 94.8%
Taylor expanded in z around 0 61.7%
*-un-lft-identity61.7%
times-frac63.4%
Applied egg-rr63.4%
Final simplification51.5%
(FPCore (x y z t) :precision binary64 (if (<= t -5.1e-135) (* (/ x y) (/ 1.0 t)) (if (<= t 3.7e-135) (/ (/ x z) (- y)) (/ x (* (- y z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.1e-135) {
tmp = (x / y) * (1.0 / t);
} else if (t <= 3.7e-135) {
tmp = (x / z) / -y;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5.1d-135)) then
tmp = (x / y) * (1.0d0 / t)
else if (t <= 3.7d-135) then
tmp = (x / z) / -y
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.1e-135) {
tmp = (x / y) * (1.0 / t);
} else if (t <= 3.7e-135) {
tmp = (x / z) / -y;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.1e-135: tmp = (x / y) * (1.0 / t) elif t <= 3.7e-135: tmp = (x / z) / -y else: tmp = x / ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.1e-135) tmp = Float64(Float64(x / y) * Float64(1.0 / t)); elseif (t <= 3.7e-135) tmp = Float64(Float64(x / z) / Float64(-y)); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -5.1e-135) tmp = (x / y) * (1.0 / t); elseif (t <= 3.7e-135) tmp = (x / z) / -y; else tmp = x / ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.1e-135], N[(N[(x / y), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e-135], N[(N[(x / z), $MachinePrecision] / (-y)), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.1 \cdot 10^{-135}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{t}\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-135}:\\
\;\;\;\;\frac{\frac{x}{z}}{-y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -5.1000000000000001e-135Initial program 89.7%
Taylor expanded in z around 0 45.7%
*-un-lft-identity45.7%
times-frac45.8%
Applied egg-rr45.8%
if -5.1000000000000001e-135 < t < 3.6999999999999997e-135Initial program 90.9%
Taylor expanded in t around 0 78.1%
associate-*r/78.1%
neg-mul-178.1%
Simplified78.1%
Taylor expanded in z around 0 41.7%
mul-1-neg41.7%
associate-/l/45.1%
distribute-neg-frac245.1%
Simplified45.1%
if 3.6999999999999997e-135 < t Initial program 84.1%
Taylor expanded in t around inf 64.4%
Final simplification51.7%
(FPCore (x y z t) :precision binary64 (if (<= y -2.5e-88) (/ (/ x y) (- t z)) (if (<= y 6.4e-61) (/ x (* z (- z t))) (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.5e-88) {
tmp = (x / y) / (t - z);
} else if (y <= 6.4e-61) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.5d-88)) then
tmp = (x / y) / (t - z)
else if (y <= 6.4d-61) then
tmp = x / (z * (z - t))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.5e-88) {
tmp = (x / y) / (t - z);
} else if (y <= 6.4e-61) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.5e-88: tmp = (x / y) / (t - z) elif y <= 6.4e-61: tmp = x / (z * (z - t)) else: tmp = (x / t) / (y - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.5e-88) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 6.4e-61) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.5e-88) tmp = (x / y) / (t - z); elseif (y <= 6.4e-61) tmp = x / (z * (z - t)); else tmp = (x / t) / (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.5e-88], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.4e-61], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-88}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{-61}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -2.50000000000000004e-88Initial program 87.0%
Taylor expanded in y around inf 75.8%
associate-/r*78.9%
Simplified78.9%
if -2.50000000000000004e-88 < y < 6.4000000000000003e-61Initial program 91.2%
Taylor expanded in y around 0 77.2%
associate-*r/77.2%
neg-mul-177.2%
Simplified77.2%
if 6.4000000000000003e-61 < y Initial program 85.6%
associate-/l/97.5%
Simplified97.5%
Taylor expanded in t around inf 58.8%
Final simplification71.8%
(FPCore (x y z t) :precision binary64 (if (<= t -1.6e-115) (/ (/ x y) (- t z)) (if (<= t 6.2e+32) (/ (/ x (- z y)) z) (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.6e-115) {
tmp = (x / y) / (t - z);
} else if (t <= 6.2e+32) {
tmp = (x / (z - y)) / z;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.6d-115)) then
tmp = (x / y) / (t - z)
else if (t <= 6.2d+32) then
tmp = (x / (z - y)) / z
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.6e-115) {
tmp = (x / y) / (t - z);
} else if (t <= 6.2e+32) {
tmp = (x / (z - y)) / z;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.6e-115: tmp = (x / y) / (t - z) elif t <= 6.2e+32: tmp = (x / (z - y)) / z else: tmp = (x / t) / (y - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.6e-115) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 6.2e+32) tmp = Float64(Float64(x / Float64(z - y)) / z); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.6e-115) tmp = (x / y) / (t - z); elseif (t <= 6.2e+32) tmp = (x / (z - y)) / z; else tmp = (x / t) / (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.6e-115], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e+32], N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-115}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+32}:\\
\;\;\;\;\frac{\frac{x}{z - y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.6e-115Initial program 89.5%
Taylor expanded in y around inf 55.7%
associate-/r*55.7%
Simplified55.7%
if -1.6e-115 < t < 6.19999999999999986e32Initial program 89.8%
associate-/r*99.0%
div-inv98.9%
Applied egg-rr98.9%
un-div-inv99.0%
clear-num98.5%
Applied egg-rr98.5%
Taylor expanded in t around 0 73.1%
associate-*r/73.1%
times-frac82.2%
associate-*l/82.2%
mul-1-neg82.2%
Simplified82.2%
if 6.19999999999999986e32 < t Initial program 81.4%
associate-/l/96.1%
Simplified96.1%
Taylor expanded in t around inf 90.9%
Final simplification73.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.12e+20) (not (<= z 5e-24))) (/ (/ x z) (- y)) (/ (/ x t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.12e+20) || !(z <= 5e-24)) {
tmp = (x / z) / -y;
} 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.12d+20)) .or. (.not. (z <= 5d-24))) then
tmp = (x / z) / -y
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.12e+20) || !(z <= 5e-24)) {
tmp = (x / z) / -y;
} else {
tmp = (x / t) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.12e+20) or not (z <= 5e-24): tmp = (x / z) / -y else: tmp = (x / t) / y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.12e+20) || !(z <= 5e-24)) tmp = Float64(Float64(x / z) / Float64(-y)); else tmp = Float64(Float64(x / t) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.12e+20) || ~((z <= 5e-24))) tmp = (x / z) / -y; else tmp = (x / t) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.12e+20], N[Not[LessEqual[z, 5e-24]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / (-y)), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{+20} \lor \neg \left(z \leq 5 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{-y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -1.12e20 or 4.9999999999999998e-24 < z Initial program 82.8%
Taylor expanded in t around 0 69.1%
associate-*r/69.1%
neg-mul-169.1%
Simplified69.1%
Taylor expanded in z around 0 35.8%
mul-1-neg35.8%
associate-/l/41.7%
distribute-neg-frac241.7%
Simplified41.7%
if -1.12e20 < z < 4.9999999999999998e-24Initial program 94.8%
Taylor expanded in z around 0 61.7%
associate-/r*62.9%
Simplified62.9%
Final simplification51.3%
(FPCore (x y z t) :precision binary64 (if (<= z -2.3e-115) (/ (- x) (* z t)) (if (<= z 5e-24) (/ (/ x t) y) (/ x (* z (- y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.3e-115) {
tmp = -x / (z * t);
} else if (z <= 5e-24) {
tmp = (x / t) / y;
} else {
tmp = x / (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.3d-115)) then
tmp = -x / (z * t)
else if (z <= 5d-24) then
tmp = (x / t) / y
else
tmp = x / (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.3e-115) {
tmp = -x / (z * t);
} else if (z <= 5e-24) {
tmp = (x / t) / y;
} else {
tmp = x / (z * -y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.3e-115: tmp = -x / (z * t) elif z <= 5e-24: tmp = (x / t) / y else: tmp = x / (z * -y) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.3e-115) tmp = Float64(Float64(-x) / Float64(z * t)); elseif (z <= 5e-24) tmp = Float64(Float64(x / t) / y); else tmp = Float64(x / Float64(z * Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.3e-115) tmp = -x / (z * t); elseif (z <= 5e-24) tmp = (x / t) / y; else tmp = x / (z * -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.3e-115], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-24], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(z * (-y)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{-115}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-24}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(-y\right)}\\
\end{array}
\end{array}
if z < -2.29999999999999985e-115Initial program 85.6%
associate-/l/98.8%
Simplified98.8%
Taylor expanded in t around inf 51.0%
Taylor expanded in y around 0 39.4%
associate-*r/39.4%
mul-1-neg39.4%
Simplified39.4%
if -2.29999999999999985e-115 < z < 4.9999999999999998e-24Initial program 93.5%
Taylor expanded in z around 0 71.6%
associate-/r*73.2%
Simplified73.2%
if 4.9999999999999998e-24 < z Initial program 85.0%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 78.8%
associate-*r/78.8%
neg-mul-178.8%
Simplified78.8%
Taylor expanded in z around 0 31.6%
associate-*r/31.6%
mul-1-neg31.6%
*-commutative31.6%
Simplified31.6%
Final simplification49.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.9e+121) (not (<= z 1.05e+30))) (/ x (* y z)) (/ x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.9e+121) || !(z <= 1.05e+30)) {
tmp = x / (y * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.9d+121)) .or. (.not. (z <= 1.05d+30))) then
tmp = x / (y * z)
else
tmp = x / (y * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.9e+121) || !(z <= 1.05e+30)) {
tmp = x / (y * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.9e+121) or not (z <= 1.05e+30): tmp = x / (y * z) else: tmp = x / (y * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.9e+121) || !(z <= 1.05e+30)) tmp = Float64(x / Float64(y * z)); else tmp = Float64(x / Float64(y * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.9e+121) || ~((z <= 1.05e+30))) tmp = x / (y * z); else tmp = x / (y * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.9e+121], N[Not[LessEqual[z, 1.05e+30]], $MachinePrecision]], N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+121} \lor \neg \left(z \leq 1.05 \cdot 10^{+30}\right):\\
\;\;\;\;\frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -2.8999999999999999e121 or 1.05e30 < z Initial program 76.9%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 86.2%
associate-*r/86.2%
neg-mul-186.2%
Simplified86.2%
div-inv86.1%
associate-/l*70.7%
add-sqr-sqrt28.9%
sqrt-unprod55.2%
sqr-neg55.2%
sqrt-unprod34.9%
add-sqr-sqrt57.0%
Applied egg-rr57.0%
associate-/r*57.1%
associate-*r/57.1%
associate-*l/57.1%
*-rgt-identity57.1%
Simplified57.1%
Taylor expanded in z around 0 33.5%
*-commutative33.5%
Simplified33.5%
if -2.8999999999999999e121 < z < 1.05e30Initial program 95.0%
Taylor expanded in z around 0 52.9%
Final simplification45.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.9e+121) (not (<= z 4.2e+30))) (/ x (* y z)) (/ (/ x t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.9e+121) || !(z <= 4.2e+30)) {
tmp = x / (y * 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 <= (-2.9d+121)) .or. (.not. (z <= 4.2d+30))) then
tmp = x / (y * 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 <= -2.9e+121) || !(z <= 4.2e+30)) {
tmp = x / (y * z);
} else {
tmp = (x / t) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.9e+121) or not (z <= 4.2e+30): tmp = x / (y * z) else: tmp = (x / t) / y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.9e+121) || !(z <= 4.2e+30)) tmp = Float64(x / Float64(y * z)); else tmp = Float64(Float64(x / t) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.9e+121) || ~((z <= 4.2e+30))) tmp = x / (y * z); else tmp = (x / t) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.9e+121], N[Not[LessEqual[z, 4.2e+30]], $MachinePrecision]], N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+121} \lor \neg \left(z \leq 4.2 \cdot 10^{+30}\right):\\
\;\;\;\;\frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -2.8999999999999999e121 or 4.2e30 < z Initial program 76.9%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 86.2%
associate-*r/86.2%
neg-mul-186.2%
Simplified86.2%
div-inv86.1%
associate-/l*70.7%
add-sqr-sqrt28.9%
sqrt-unprod55.2%
sqr-neg55.2%
sqrt-unprod34.9%
add-sqr-sqrt57.0%
Applied egg-rr57.0%
associate-/r*57.1%
associate-*r/57.1%
associate-*l/57.1%
*-rgt-identity57.1%
Simplified57.1%
Taylor expanded in z around 0 33.5%
*-commutative33.5%
Simplified33.5%
if -2.8999999999999999e121 < z < 4.2e30Initial program 95.0%
Taylor expanded in z around 0 52.9%
associate-/r*53.8%
Simplified53.8%
Final simplification46.2%
(FPCore (x y z t) :precision binary64 (if (<= y -1.3e-90) (/ x (* y (- t z))) (/ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.3e-90) {
tmp = x / (y * (t - z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.3d-90)) then
tmp = x / (y * (t - z))
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.3e-90) {
tmp = x / (y * (t - z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.3e-90: tmp = x / (y * (t - z)) else: tmp = x / ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.3e-90) tmp = Float64(x / Float64(y * Float64(t - z))); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.3e-90) tmp = x / (y * (t - z)); else tmp = x / ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.3e-90], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-90}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -1.3e-90Initial program 87.3%
Taylor expanded in y around inf 73.9%
*-commutative73.9%
Simplified73.9%
if -1.3e-90 < y Initial program 88.6%
Taylor expanded in t around inf 56.9%
Final simplification61.9%
(FPCore (x y z t) :precision binary64 (if (<= t 2.15e-29) (/ x (* y (- t z))) (/ (/ x t) (- y z))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.15e-29) {
tmp = x / (y * (t - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 2.15d-29) then
tmp = x / (y * (t - z))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.15e-29) {
tmp = x / (y * (t - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 2.15e-29: tmp = x / (y * (t - z)) else: tmp = (x / t) / (y - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 2.15e-29) tmp = Float64(x / Float64(y * Float64(t - z))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 2.15e-29) tmp = x / (y * (t - z)); else tmp = (x / t) / (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 2.15e-29], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.15 \cdot 10^{-29}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 2.1499999999999999e-29Initial program 89.0%
Taylor expanded in y around inf 53.8%
*-commutative53.8%
Simplified53.8%
if 2.1499999999999999e-29 < t Initial program 85.5%
associate-/l/96.9%
Simplified96.9%
Taylor expanded in t around inf 87.1%
Final simplification61.5%
(FPCore (x y z t) :precision binary64 (if (<= y -1.3e-90) (/ (/ x y) (- t z)) (/ (/ x t) (- y z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.3e-90) {
tmp = (x / y) / (t - z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.3d-90)) then
tmp = (x / y) / (t - z)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.3e-90) {
tmp = (x / y) / (t - z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.3e-90: tmp = (x / y) / (t - z) else: tmp = (x / t) / (y - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.3e-90) tmp = Float64(Float64(x / y) / Float64(t - z)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.3e-90) tmp = (x / y) / (t - z); else tmp = (x / t) / (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.3e-90], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-90}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.3e-90Initial program 87.3%
Taylor expanded in y around inf 73.9%
associate-/r*76.9%
Simplified76.9%
if -1.3e-90 < y Initial program 88.6%
associate-/l/97.3%
Simplified97.3%
Taylor expanded in t around inf 58.3%
Final simplification63.8%
(FPCore (x y z t) :precision binary64 (if (<= y -1.3e-90) (/ (/ x y) (- t z)) (/ (/ x (- y z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.3e-90) {
tmp = (x / y) / (t - z);
} else {
tmp = (x / (y - z)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.3d-90)) then
tmp = (x / y) / (t - z)
else
tmp = (x / (y - z)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.3e-90) {
tmp = (x / y) / (t - z);
} else {
tmp = (x / (y - z)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.3e-90: tmp = (x / y) / (t - z) else: tmp = (x / (y - z)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.3e-90) tmp = Float64(Float64(x / y) / Float64(t - z)); else tmp = Float64(Float64(x / Float64(y - z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.3e-90) tmp = (x / y) / (t - z); else tmp = (x / (y - z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.3e-90], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-90}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t}\\
\end{array}
\end{array}
if y < -1.3e-90Initial program 87.3%
Taylor expanded in y around inf 73.9%
associate-/r*76.9%
Simplified76.9%
if -1.3e-90 < y Initial program 88.6%
associate-/r*99.2%
div-inv99.1%
Applied egg-rr99.1%
Taylor expanded in t around inf 56.9%
*-commutative56.9%
associate-/r*61.4%
Simplified61.4%
Final simplification65.9%
(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 88.2%
associate-/l/97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x y z t) :precision binary64 (/ x (* y t)))
double code(double x, double y, double z, double t) {
return x / (y * t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / (y * t)
end function
public static double code(double x, double y, double z, double t) {
return x / (y * t);
}
def code(x, y, z, t): return x / (y * t)
function code(x, y, z, t) return Float64(x / Float64(y * t)) end
function tmp = code(x, y, z, t) tmp = x / (y * t); end
code[x_, y_, z_, t_] := N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y \cdot t}
\end{array}
Initial program 88.2%
Taylor expanded in z around 0 38.8%
Final simplification38.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 2024055
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:alt
(if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))
(/ x (* (- y z) (- t z))))