
(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 11 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 86.3%
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
(let* ((t_1 (- x (* y (/ x z)))))
(if (<= z -3.5e+35)
t_1
(if (<= z -1.9e-104)
(/ (* x z) (- z t))
(if (<= z 9.6e+76) (* x (/ y (- t z))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x - (y * (x / z));
double tmp;
if (z <= -3.5e+35) {
tmp = t_1;
} else if (z <= -1.9e-104) {
tmp = (x * z) / (z - t);
} else if (z <= 9.6e+76) {
tmp = x * (y / (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 - (y * (x / z))
if (z <= (-3.5d+35)) then
tmp = t_1
else if (z <= (-1.9d-104)) then
tmp = (x * z) / (z - t)
else if (z <= 9.6d+76) then
tmp = x * (y / (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 - (y * (x / z));
double tmp;
if (z <= -3.5e+35) {
tmp = t_1;
} else if (z <= -1.9e-104) {
tmp = (x * z) / (z - t);
} else if (z <= 9.6e+76) {
tmp = x * (y / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (y * (x / z)) tmp = 0 if z <= -3.5e+35: tmp = t_1 elif z <= -1.9e-104: tmp = (x * z) / (z - t) elif z <= 9.6e+76: tmp = x * (y / (t - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(y * Float64(x / z))) tmp = 0.0 if (z <= -3.5e+35) tmp = t_1; elseif (z <= -1.9e-104) tmp = Float64(Float64(x * z) / Float64(z - t)); elseif (z <= 9.6e+76) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (y * (x / z)); tmp = 0.0; if (z <= -3.5e+35) tmp = t_1; elseif (z <= -1.9e-104) tmp = (x * z) / (z - t); elseif (z <= 9.6e+76) tmp = x * (y / (t - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e+35], t$95$1, If[LessEqual[z, -1.9e-104], N[(N[(x * z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.6e+76], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-104}:\\
\;\;\;\;\frac{x \cdot z}{z - t}\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{+76}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.5000000000000001e35 or 9.5999999999999999e76 < z Initial program 73.9%
Taylor expanded in t around 0
mul-1-negN/A
neg-sub0N/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-/l*N/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6482.2
Simplified82.2%
if -3.5000000000000001e35 < z < -1.9e-104Initial program 93.4%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6496.2
Applied egg-rr96.2%
Taylor expanded in y around 0
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6462.4
Simplified62.4%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6469.0
Applied egg-rr69.0%
if -1.9e-104 < z < 9.5999999999999999e76Initial program 95.2%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6476.8
Simplified76.8%
Final simplification78.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ z (- z t)))))
(if (<= z -9.5e+187)
t_1
(if (<= z 1.85e+139) (* (- y z) (/ x (- t z))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z / (z - t));
double tmp;
if (z <= -9.5e+187) {
tmp = t_1;
} else if (z <= 1.85e+139) {
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 * (z / (z - t))
if (z <= (-9.5d+187)) then
tmp = t_1
else if (z <= 1.85d+139) 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 * (z / (z - t));
double tmp;
if (z <= -9.5e+187) {
tmp = t_1;
} else if (z <= 1.85e+139) {
tmp = (y - z) * (x / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z / (z - t)) tmp = 0 if z <= -9.5e+187: tmp = t_1 elif z <= 1.85e+139: tmp = (y - z) * (x / (t - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z / Float64(z - t))) tmp = 0.0 if (z <= -9.5e+187) tmp = t_1; elseif (z <= 1.85e+139) 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 * (z / (z - t)); tmp = 0.0; if (z <= -9.5e+187) tmp = t_1; elseif (z <= 1.85e+139) 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[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.5e+187], t$95$1, If[LessEqual[z, 1.85e+139], N[(N[(y - z), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z}{z - t}\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+187}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+139}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.4999999999999996e187 or 1.84999999999999996e139 < z Initial program 62.0%
Taylor expanded in y around 0
mul-1-negN/A
neg-lowering-neg.f6457.2
Simplified57.2%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-frac-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
--lowering--.f6492.2
Applied egg-rr92.2%
if -9.4999999999999996e187 < z < 1.84999999999999996e139Initial program 94.0%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6491.3
Applied egg-rr91.3%
Final simplification91.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ y (- t z))))) (if (<= y -1.95e+123) t_1 (if (<= y 7.6e+22) (* x (/ z (- z t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (y <= -1.95e+123) {
tmp = t_1;
} else if (y <= 7.6e+22) {
tmp = x * (z / (z - t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (y / (t - z))
if (y <= (-1.95d+123)) then
tmp = t_1
else if (y <= 7.6d+22) then
tmp = x * (z / (z - t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (y <= -1.95e+123) {
tmp = t_1;
} else if (y <= 7.6e+22) {
tmp = x * (z / (z - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / (t - z)) tmp = 0 if y <= -1.95e+123: tmp = t_1 elif y <= 7.6e+22: tmp = x * (z / (z - t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / Float64(t - z))) tmp = 0.0 if (y <= -1.95e+123) tmp = t_1; elseif (y <= 7.6e+22) tmp = Float64(x * Float64(z / Float64(z - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / (t - z)); tmp = 0.0; if (y <= -1.95e+123) tmp = t_1; elseif (y <= 7.6e+22) tmp = x * (z / (z - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.95e+123], t$95$1, If[LessEqual[y, 7.6e+22], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{t - z}\\
\mathbf{if}\;y \leq -1.95 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{+22}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.94999999999999996e123 or 7.6000000000000008e22 < y Initial program 84.9%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6484.3
Simplified84.3%
if -1.94999999999999996e123 < y < 7.6000000000000008e22Initial program 87.0%
Taylor expanded in y around 0
mul-1-negN/A
neg-lowering-neg.f6469.8
Simplified69.8%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-frac-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
--lowering--.f6480.9
Applied egg-rr80.9%
Final simplification82.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- x (* y (/ x z))))) (if (<= z -0.032) t_1 (if (<= z 2.8e+76) (* x (/ y (- t z))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x - (y * (x / z));
double tmp;
if (z <= -0.032) {
tmp = t_1;
} else if (z <= 2.8e+76) {
tmp = x * (y / (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 - (y * (x / z))
if (z <= (-0.032d0)) then
tmp = t_1
else if (z <= 2.8d+76) then
tmp = x * (y / (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 - (y * (x / z));
double tmp;
if (z <= -0.032) {
tmp = t_1;
} else if (z <= 2.8e+76) {
tmp = x * (y / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (y * (x / z)) tmp = 0 if z <= -0.032: tmp = t_1 elif z <= 2.8e+76: tmp = x * (y / (t - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(y * Float64(x / z))) tmp = 0.0 if (z <= -0.032) tmp = t_1; elseif (z <= 2.8e+76) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (y * (x / z)); tmp = 0.0; if (z <= -0.032) tmp = t_1; elseif (z <= 2.8e+76) tmp = x * (y / (t - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.032], t$95$1, If[LessEqual[z, 2.8e+76], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -0.032:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+76}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.032000000000000001 or 2.7999999999999999e76 < z Initial program 75.5%
Taylor expanded in t around 0
mul-1-negN/A
neg-sub0N/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-/l*N/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6481.6
Simplified81.6%
if -0.032000000000000001 < z < 2.7999999999999999e76Initial program 94.6%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6472.1
Simplified72.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ y (- t z))))) (if (<= y -3.8e-23) t_1 (if (<= y 4.2e+20) (* z (/ x (- z t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (y <= -3.8e-23) {
tmp = t_1;
} else if (y <= 4.2e+20) {
tmp = z * (x / (z - t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (y / (t - z))
if (y <= (-3.8d-23)) then
tmp = t_1
else if (y <= 4.2d+20) then
tmp = z * (x / (z - t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (y <= -3.8e-23) {
tmp = t_1;
} else if (y <= 4.2e+20) {
tmp = z * (x / (z - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / (t - z)) tmp = 0 if y <= -3.8e-23: tmp = t_1 elif y <= 4.2e+20: tmp = z * (x / (z - t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / Float64(t - z))) tmp = 0.0 if (y <= -3.8e-23) tmp = t_1; elseif (y <= 4.2e+20) tmp = Float64(z * Float64(x / Float64(z - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / (t - z)); tmp = 0.0; if (y <= -3.8e-23) tmp = t_1; elseif (y <= 4.2e+20) tmp = z * (x / (z - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.8e-23], t$95$1, If[LessEqual[y, 4.2e+20], N[(z * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{t - z}\\
\mathbf{if}\;y \leq -3.8 \cdot 10^{-23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+20}:\\
\;\;\;\;z \cdot \frac{x}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.80000000000000011e-23 or 4.2e20 < y Initial program 86.4%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6475.2
Simplified75.2%
if -3.80000000000000011e-23 < y < 4.2e20Initial program 86.1%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.1
Applied egg-rr97.1%
Taylor expanded in y around 0
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6472.8
Simplified72.8%
(FPCore (x y z t) :precision binary64 (if (<= z -0.49) x (if (<= z 1.9e+139) (* x (/ y (- t z))) (fma x (/ t z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.49) {
tmp = x;
} else if (z <= 1.9e+139) {
tmp = x * (y / (t - z));
} else {
tmp = fma(x, (t / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -0.49) tmp = x; elseif (z <= 1.9e+139) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = fma(x, Float64(t / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.49], x, If[LessEqual[z, 1.9e+139], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.49:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+139}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{t}{z}, x\right)\\
\end{array}
\end{array}
if z < -0.48999999999999999Initial program 73.4%
Taylor expanded in z around inf
Simplified71.1%
if -0.48999999999999999 < z < 1.9e139Initial program 94.6%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6470.4
Simplified70.4%
if 1.9e139 < z Initial program 70.2%
Taylor expanded in y around 0
mul-1-negN/A
neg-lowering-neg.f6462.0
Simplified62.0%
Taylor expanded in z around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6485.4
Simplified85.4%
(FPCore (x y z t) :precision binary64 (if (<= z -2.1e-60) x (if (<= z 3.4e+87) (* x (/ y t)) (fma x (/ t z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.1e-60) {
tmp = x;
} else if (z <= 3.4e+87) {
tmp = x * (y / t);
} else {
tmp = fma(x, (t / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -2.1e-60) tmp = x; elseif (z <= 3.4e+87) tmp = Float64(x * Float64(y / t)); else tmp = fma(x, Float64(t / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.1e-60], x, If[LessEqual[z, 3.4e+87], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-60}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+87}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{t}{z}, x\right)\\
\end{array}
\end{array}
if z < -2.09999999999999991e-60Initial program 75.2%
Taylor expanded in z around inf
Simplified66.6%
if -2.09999999999999991e-60 < z < 3.4000000000000002e87Initial program 95.7%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.6
Applied egg-rr95.6%
Taylor expanded in y around inf
/-lowering-/.f64N/A
--lowering--.f6474.2
Simplified74.2%
clear-numN/A
associate-/r/N/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6474.2
Applied egg-rr74.2%
Taylor expanded in t around inf
/-lowering-/.f6463.3
Simplified63.3%
if 3.4000000000000002e87 < z Initial program 75.7%
Taylor expanded in y around 0
mul-1-negN/A
neg-lowering-neg.f6459.1
Simplified59.1%
Taylor expanded in z around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6474.5
Simplified74.5%
Final simplification66.3%
(FPCore (x y z t) :precision binary64 (if (<= z -1.3e-60) x (if (<= z 4.5e+88) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.3e-60) {
tmp = x;
} else if (z <= 4.5e+88) {
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 <= (-1.3d-60)) then
tmp = x
else if (z <= 4.5d+88) 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 <= -1.3e-60) {
tmp = x;
} else if (z <= 4.5e+88) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.3e-60: tmp = x elif z <= 4.5e+88: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.3e-60) tmp = x; elseif (z <= 4.5e+88) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.3e-60) tmp = x; elseif (z <= 4.5e+88) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.3e-60], x, If[LessEqual[z, 4.5e+88], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{-60}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+88}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.2999999999999999e-60 or 4.5e88 < z Initial program 75.4%
Taylor expanded in z around inf
Simplified69.5%
if -1.2999999999999999e-60 < z < 4.5e88Initial program 95.7%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.6
Applied egg-rr95.6%
Taylor expanded in y around inf
/-lowering-/.f64N/A
--lowering--.f6474.2
Simplified74.2%
clear-numN/A
associate-/r/N/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6474.2
Applied egg-rr74.2%
Taylor expanded in t around inf
/-lowering-/.f6463.3
Simplified63.3%
Final simplification66.2%
(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}
\\
x \cdot \frac{y - z}{t - z}
\end{array}
Initial program 86.3%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.6
Applied egg-rr97.6%
Final simplification97.6%
(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 86.3%
Taylor expanded in z around inf
Simplified40.8%
(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 2024199
(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)))