
(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(Float64(x * 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[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 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(Float64(x * 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[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\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(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
Initial program 84.1%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.6%
Applied egg-rr97.6%
(FPCore (x y z t) :precision binary64 (if (<= z -3.1e+98) (/ x (- 1.0 (/ t z))) (if (<= z 2.9e+164) (* (- y z) (/ x (- t z))) (/ x (+ (/ (- y t) z) 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.1e+98) {
tmp = x / (1.0 - (t / z));
} else if (z <= 2.9e+164) {
tmp = (y - z) * (x / (t - z));
} else {
tmp = x / (((y - t) / z) + 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 (z <= (-3.1d+98)) then
tmp = x / (1.0d0 - (t / z))
else if (z <= 2.9d+164) then
tmp = (y - z) * (x / (t - z))
else
tmp = x / (((y - t) / z) + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.1e+98) {
tmp = x / (1.0 - (t / z));
} else if (z <= 2.9e+164) {
tmp = (y - z) * (x / (t - z));
} else {
tmp = x / (((y - t) / z) + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.1e+98: tmp = x / (1.0 - (t / z)) elif z <= 2.9e+164: tmp = (y - z) * (x / (t - z)) else: tmp = x / (((y - t) / z) + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.1e+98) tmp = Float64(x / Float64(1.0 - Float64(t / z))); elseif (z <= 2.9e+164) tmp = Float64(Float64(y - z) * Float64(x / Float64(t - z))); else tmp = Float64(x / Float64(Float64(Float64(y - t) / z) + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.1e+98) tmp = x / (1.0 - (t / z)); elseif (z <= 2.9e+164) tmp = (y - z) * (x / (t - z)); else tmp = x / (((y - t) / z) + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.1e+98], N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+164], N[(N[(y - z), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(N[(y - t), $MachinePrecision] / z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+98}:\\
\;\;\;\;\frac{x}{1 - \frac{t}{z}}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+164}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y - t}{z} + 1}\\
\end{array}
\end{array}
if z < -3.10000000000000019e98Initial program 65.4%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6493.6%
Simplified93.6%
Taylor expanded in y around 0
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6493.7%
Simplified93.7%
if -3.10000000000000019e98 < z < 2.8999999999999999e164Initial program 90.9%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6492.5%
Applied egg-rr92.5%
if 2.8999999999999999e164 < z Initial program 72.5%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6490.5%
Simplified90.5%
Final simplification92.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (- 1.0 (/ t z)))))
(if (<= z -2.2e+98)
t_1
(if (<= z 6.6e+163) (* (- y z) (/ x (- t z))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x / (1.0 - (t / z));
double tmp;
if (z <= -2.2e+98) {
tmp = t_1;
} else if (z <= 6.6e+163) {
tmp = (y - z) * (x / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 - (t / z))
if (z <= (-2.2d+98)) then
tmp = t_1
else if (z <= 6.6d+163) then
tmp = (y - z) * (x / (t - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (1.0 - (t / z));
double tmp;
if (z <= -2.2e+98) {
tmp = t_1;
} else if (z <= 6.6e+163) {
tmp = (y - z) * (x / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (1.0 - (t / z)) tmp = 0 if z <= -2.2e+98: tmp = t_1 elif z <= 6.6e+163: tmp = (y - z) * (x / (t - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(1.0 - Float64(t / z))) tmp = 0.0 if (z <= -2.2e+98) tmp = t_1; elseif (z <= 6.6e+163) tmp = Float64(Float64(y - z) * Float64(x / Float64(t - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (1.0 - (t / z)); tmp = 0.0; if (z <= -2.2e+98) tmp = t_1; elseif (z <= 6.6e+163) tmp = (y - z) * (x / (t - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+98], t$95$1, If[LessEqual[z, 6.6e+163], N[(N[(y - z), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - \frac{t}{z}}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+163}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.20000000000000009e98 or 6.5999999999999999e163 < z Initial program 68.3%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6492.3%
Simplified92.3%
Taylor expanded in y around 0
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6492.3%
Simplified92.3%
if -2.20000000000000009e98 < z < 6.5999999999999999e163Initial program 90.9%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6492.5%
Applied egg-rr92.5%
Final simplification92.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (- 1.0 (/ t z))))) (if (<= z -1.55e+22) t_1 (if (<= z 4.2e-70) (* y (/ x (- t z))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x / (1.0 - (t / z));
double tmp;
if (z <= -1.55e+22) {
tmp = t_1;
} else if (z <= 4.2e-70) {
tmp = y * (x / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 - (t / z))
if (z <= (-1.55d+22)) then
tmp = t_1
else if (z <= 4.2d-70) then
tmp = y * (x / (t - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (1.0 - (t / z));
double tmp;
if (z <= -1.55e+22) {
tmp = t_1;
} else if (z <= 4.2e-70) {
tmp = y * (x / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (1.0 - (t / z)) tmp = 0 if z <= -1.55e+22: tmp = t_1 elif z <= 4.2e-70: tmp = y * (x / (t - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(1.0 - Float64(t / z))) tmp = 0.0 if (z <= -1.55e+22) tmp = t_1; elseif (z <= 4.2e-70) tmp = Float64(y * Float64(x / Float64(t - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (1.0 - (t / z)); tmp = 0.0; if (z <= -1.55e+22) tmp = t_1; elseif (z <= 4.2e-70) tmp = y * (x / (t - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.55e+22], t$95$1, If[LessEqual[z, 4.2e-70], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - \frac{t}{z}}\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-70}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.5500000000000001e22 or 4.2000000000000002e-70 < z Initial program 77.5%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6483.6%
Simplified83.6%
Taylor expanded in y around 0
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6483.5%
Simplified83.5%
if -1.5500000000000001e22 < z < 4.2000000000000002e-70Initial program 93.7%
Taylor expanded in y around inf
*-commutativeN/A
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6478.6%
Simplified78.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ (- y z) t)))) (if (<= t -1.7e+47) t_1 (if (<= t 4.3e+14) (* x (- 1.0 (/ y z))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y - z) / t);
double tmp;
if (t <= -1.7e+47) {
tmp = t_1;
} else if (t <= 4.3e+14) {
tmp = x * (1.0 - (y / z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((y - z) / t)
if (t <= (-1.7d+47)) then
tmp = t_1
else if (t <= 4.3d+14) then
tmp = x * (1.0d0 - (y / z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y - z) / t);
double tmp;
if (t <= -1.7e+47) {
tmp = t_1;
} else if (t <= 4.3e+14) {
tmp = x * (1.0 - (y / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y - z) / t) tmp = 0 if t <= -1.7e+47: tmp = t_1 elif t <= 4.3e+14: tmp = x * (1.0 - (y / z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y - z) / t)) tmp = 0.0 if (t <= -1.7e+47) tmp = t_1; elseif (t <= 4.3e+14) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y - z) / t); tmp = 0.0; if (t <= -1.7e+47) tmp = t_1; elseif (t <= 4.3e+14) tmp = x * (1.0 - (y / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.7e+47], t$95$1, If[LessEqual[t, 4.3e+14], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y - z}{t}\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.6999999999999999e47 or 4.3e14 < t Initial program 84.3%
Taylor expanded in t around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6477.7%
Simplified77.7%
if -1.6999999999999999e47 < t < 4.3e14Initial program 83.9%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6481.9%
Simplified81.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (- 1.0 (/ y z))))) (if (<= z -4.5e-44) t_1 (if (<= z 7.2e-37) (/ (* x y) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -4.5e-44) {
tmp = t_1;
} else if (z <= 7.2e-37) {
tmp = (x * y) / t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (1.0d0 - (y / z))
if (z <= (-4.5d-44)) then
tmp = t_1
else if (z <= 7.2d-37) then
tmp = (x * y) / t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -4.5e-44) {
tmp = t_1;
} else if (z <= 7.2e-37) {
tmp = (x * y) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if z <= -4.5e-44: tmp = t_1 elif z <= 7.2e-37: tmp = (x * y) / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -4.5e-44) tmp = t_1; elseif (z <= 7.2e-37) tmp = Float64(Float64(x * y) / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / z)); tmp = 0.0; if (z <= -4.5e-44) tmp = t_1; elseif (z <= 7.2e-37) tmp = (x * y) / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e-44], t$95$1, If[LessEqual[z, 7.2e-37], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-37}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.4999999999999999e-44 or 7.20000000000000014e-37 < z Initial program 77.9%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6467.9%
Simplified67.9%
if -4.4999999999999999e-44 < z < 7.20000000000000014e-37Initial program 94.3%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6471.4%
Simplified71.4%
(FPCore (x y z t) :precision binary64 (if (<= z -5e-44) x (if (<= z 7.6e-37) (/ (* x y) t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5e-44) {
tmp = x;
} else if (z <= 7.6e-37) {
tmp = (x * y) / t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-5d-44)) then
tmp = x
else if (z <= 7.6d-37) then
tmp = (x * y) / t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5e-44) {
tmp = x;
} else if (z <= 7.6e-37) {
tmp = (x * y) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5e-44: tmp = x elif z <= 7.6e-37: tmp = (x * y) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5e-44) tmp = x; elseif (z <= 7.6e-37) tmp = Float64(Float64(x * y) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5e-44) tmp = x; elseif (z <= 7.6e-37) tmp = (x * y) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5e-44], x, If[LessEqual[z, 7.6e-37], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-37}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.00000000000000039e-44 or 7.6000000000000008e-37 < z Initial program 77.9%
Taylor expanded in z around inf
Simplified53.7%
if -5.00000000000000039e-44 < z < 7.6000000000000008e-37Initial program 94.3%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6471.4%
Simplified71.4%
(FPCore (x y z t) :precision binary64 (if (<= z -5.5e-45) x (if (<= z 8.6e-37) (* y (/ x t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.5e-45) {
tmp = x;
} else if (z <= 8.6e-37) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-5.5d-45)) then
tmp = x
else if (z <= 8.6d-37) then
tmp = y * (x / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.5e-45) {
tmp = x;
} else if (z <= 8.6e-37) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.5e-45: tmp = x elif z <= 8.6e-37: tmp = y * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.5e-45) tmp = x; elseif (z <= 8.6e-37) tmp = Float64(y * Float64(x / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.5e-45) tmp = x; elseif (z <= 8.6e-37) tmp = y * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.5e-45], x, If[LessEqual[z, 8.6e-37], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-45}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-37}:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.5000000000000003e-45 or 8.59999999999999936e-37 < z Initial program 77.9%
Taylor expanded in z around inf
Simplified53.7%
if -5.5000000000000003e-45 < z < 8.59999999999999936e-37Initial program 94.3%
Taylor expanded in y around inf
*-commutativeN/A
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6479.0%
Simplified79.0%
Taylor expanded in t around inf
Simplified71.3%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 84.1%
Taylor expanded in z around inf
Simplified37.4%
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((t - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
herbie shell --seed 2024161
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (/ x (/ (- t z) (- y z))))
(/ (* x (- y z)) (- t z)))