
(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 82.9%
lift--.f64N/A
lift-*.f64N/A
remove-double-negN/A
lift--.f64N/A
remove-double-negN/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6496.3
Applied egg-rr96.3%
(FPCore (x y z t)
:precision binary64
(if (<= z -4e+71)
x
(if (<= z -1.65e-130)
(- (/ (* x z) t))
(if (<= z 3.5e-96) (/ (* x y) t) (fma x (/ t z) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4e+71) {
tmp = x;
} else if (z <= -1.65e-130) {
tmp = -((x * z) / t);
} else if (z <= 3.5e-96) {
tmp = (x * y) / t;
} else {
tmp = fma(x, (t / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -4e+71) tmp = x; elseif (z <= -1.65e-130) tmp = Float64(-Float64(Float64(x * z) / t)); elseif (z <= 3.5e-96) tmp = Float64(Float64(x * y) / t); else tmp = fma(x, Float64(t / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -4e+71], x, If[LessEqual[z, -1.65e-130], (-N[(N[(x * z), $MachinePrecision] / t), $MachinePrecision]), If[LessEqual[z, 3.5e-96], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+71}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-130}:\\
\;\;\;\;-\frac{x \cdot z}{t}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-96}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{t}{z}, x\right)\\
\end{array}
\end{array}
if z < -4.0000000000000002e71Initial program 66.7%
lift--.f64N/A
lift-*.f64N/A
remove-double-negN/A
lift--.f64N/A
remove-double-negN/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.8
Applied egg-rr99.8%
Taylor expanded in z around inf
Simplified61.9%
/-rgt-identity61.9
Applied egg-rr61.9%
if -4.0000000000000002e71 < z < -1.6499999999999999e-130Initial program 94.9%
lift--.f64N/A
lift-*.f64N/A
remove-double-negN/A
lift--.f64N/A
remove-double-negN/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6497.1
Applied egg-rr97.1%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6460.5
Simplified60.5%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f6448.7
Simplified48.7%
if -1.6499999999999999e-130 < z < 3.4999999999999999e-96Initial program 94.5%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6479.8
Simplified79.8%
if 3.4999999999999999e-96 < z Initial program 74.5%
lift--.f64N/A
lift-*.f64N/A
remove-double-negN/A
lift--.f64N/A
remove-double-negN/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6498.6
Applied egg-rr98.6%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6465.0
Simplified65.0%
Taylor expanded in z around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6452.8
Simplified52.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ (- z y) z)))) (if (<= z -2.6e+170) t_1 (if (<= z 2e+128) (* (- y z) (/ x (- t z))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((z - y) / z);
double tmp;
if (z <= -2.6e+170) {
tmp = t_1;
} else if (z <= 2e+128) {
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 - y) / z)
if (z <= (-2.6d+170)) then
tmp = t_1
else if (z <= 2d+128) 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 - y) / z);
double tmp;
if (z <= -2.6e+170) {
tmp = t_1;
} else if (z <= 2e+128) {
tmp = (y - z) * (x / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((z - y) / z) tmp = 0 if z <= -2.6e+170: tmp = t_1 elif z <= 2e+128: tmp = (y - z) * (x / (t - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(z - y) / z)) tmp = 0.0 if (z <= -2.6e+170) tmp = t_1; elseif (z <= 2e+128) 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 - y) / z); tmp = 0.0; if (z <= -2.6e+170) tmp = t_1; elseif (z <= 2e+128) 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[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e+170], t$95$1, If[LessEqual[z, 2e+128], 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 - y}{z}\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+128}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.5999999999999998e170 or 2.0000000000000002e128 < z Initial program 57.1%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6451.6
Simplified51.6%
lift--.f64N/A
lift-neg.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
lift-neg.f64N/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
lift-neg.f64N/A
remove-double-negN/A
lower--.f6488.6
Applied egg-rr88.6%
if -2.5999999999999998e170 < z < 2.0000000000000002e128Initial program 91.5%
lift--.f64N/A
lift-*.f64N/A
remove-double-negN/A
lift--.f64N/A
remove-double-negN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6491.7
Applied egg-rr91.7%
Final simplification90.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ (- z y) z)))) (if (<= z -9e+69) t_1 (if (<= z 1.3e+23) (/ (* x (- y z)) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((z - y) / z);
double tmp;
if (z <= -9e+69) {
tmp = t_1;
} else if (z <= 1.3e+23) {
tmp = (x * (y - z)) / t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((z - y) / z)
if (z <= (-9d+69)) then
tmp = t_1
else if (z <= 1.3d+23) then
tmp = (x * (y - z)) / t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((z - y) / z);
double tmp;
if (z <= -9e+69) {
tmp = t_1;
} else if (z <= 1.3e+23) {
tmp = (x * (y - z)) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((z - y) / z) tmp = 0 if z <= -9e+69: tmp = t_1 elif z <= 1.3e+23: tmp = (x * (y - z)) / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(z - y) / z)) tmp = 0.0 if (z <= -9e+69) tmp = t_1; elseif (z <= 1.3e+23) tmp = Float64(Float64(x * Float64(y - z)) / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((z - y) / z); tmp = 0.0; if (z <= -9e+69) tmp = t_1; elseif (z <= 1.3e+23) tmp = (x * (y - z)) / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9e+69], t$95$1, If[LessEqual[z, 1.3e+23], N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z - y}{z}\\
\mathbf{if}\;z \leq -9 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+23}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.9999999999999999e69 or 1.29999999999999996e23 < z Initial program 66.4%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6455.9
Simplified55.9%
lift--.f64N/A
lift-neg.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
lift-neg.f64N/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
lift-neg.f64N/A
remove-double-negN/A
lower--.f6482.4
Applied egg-rr82.4%
if -8.9999999999999999e69 < z < 1.29999999999999996e23Initial program 94.7%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6476.0
Simplified76.0%
Final simplification78.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ y (- t z))))) (if (<= y -3.5e-65) t_1 (if (<= y 9e-7) (* 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 <= -3.5e-65) {
tmp = t_1;
} else if (y <= 9e-7) {
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 <= (-3.5d-65)) then
tmp = t_1
else if (y <= 9d-7) 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 <= -3.5e-65) {
tmp = t_1;
} else if (y <= 9e-7) {
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 <= -3.5e-65: tmp = t_1 elif y <= 9e-7: 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 <= -3.5e-65) tmp = t_1; elseif (y <= 9e-7) 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 <= -3.5e-65) tmp = t_1; elseif (y <= 9e-7) 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, -3.5e-65], t$95$1, If[LessEqual[y, 9e-7], 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 -3.5 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-7}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.50000000000000005e-65 or 8.99999999999999959e-7 < y Initial program 83.1%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6473.4
Simplified73.4%
if -3.50000000000000005e-65 < y < 8.99999999999999959e-7Initial program 82.7%
lift--.f64N/A
lift-*.f64N/A
remove-double-negN/A
lift--.f64N/A
remove-double-negN/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6495.7
Applied egg-rr95.7%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6481.7
Simplified81.7%
(FPCore (x y z t) :precision binary64 (if (<= z -8.2e+80) x (if (<= z 2.3e+137) (* x (/ y (- t z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.2e+80) {
tmp = x;
} else if (z <= 2.3e+137) {
tmp = x * (y / (t - z));
} 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 <= (-8.2d+80)) then
tmp = x
else if (z <= 2.3d+137) then
tmp = x * (y / (t - z))
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 <= -8.2e+80) {
tmp = x;
} else if (z <= 2.3e+137) {
tmp = x * (y / (t - z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.2e+80: tmp = x elif z <= 2.3e+137: tmp = x * (y / (t - z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.2e+80) tmp = x; elseif (z <= 2.3e+137) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -8.2e+80) tmp = x; elseif (z <= 2.3e+137) tmp = x * (y / (t - z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.2e+80], x, If[LessEqual[z, 2.3e+137], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+80}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+137}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.20000000000000003e80 or 2.29999999999999999e137 < z Initial program 61.3%
lift--.f64N/A
lift-*.f64N/A
remove-double-negN/A
lift--.f64N/A
remove-double-negN/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.8
Applied egg-rr99.8%
Taylor expanded in z around inf
Simplified66.0%
/-rgt-identity66.0
Applied egg-rr66.0%
if -8.20000000000000003e80 < z < 2.29999999999999999e137Initial program 93.3%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6464.5
Simplified64.5%
(FPCore (x y z t) :precision binary64 (if (<= z -2.1e-39) x (if (<= z 3.5e-96) (/ (* x y) t) (fma x (/ t z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.1e-39) {
tmp = x;
} else if (z <= 3.5e-96) {
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-39) tmp = x; elseif (z <= 3.5e-96) tmp = Float64(Float64(x * y) / t); else tmp = fma(x, Float64(t / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.1e-39], x, If[LessEqual[z, 3.5e-96], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-39}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-96}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{t}{z}, x\right)\\
\end{array}
\end{array}
if z < -2.09999999999999993e-39Initial program 72.8%
lift--.f64N/A
lift-*.f64N/A
remove-double-negN/A
lift--.f64N/A
remove-double-negN/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.8
Applied egg-rr99.8%
Taylor expanded in z around inf
Simplified52.1%
/-rgt-identity52.1
Applied egg-rr52.1%
if -2.09999999999999993e-39 < z < 3.4999999999999999e-96Initial program 95.4%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6472.7
Simplified72.7%
if 3.4999999999999999e-96 < z Initial program 74.5%
lift--.f64N/A
lift-*.f64N/A
remove-double-negN/A
lift--.f64N/A
remove-double-negN/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6498.6
Applied egg-rr98.6%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6465.0
Simplified65.0%
Taylor expanded in z around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6452.8
Simplified52.8%
(FPCore (x y z t) :precision binary64 (if (<= z -2.1e-39) x (if (<= z 1.95e+21) (/ (* x y) t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.1e-39) {
tmp = x;
} else if (z <= 1.95e+21) {
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 <= (-2.1d-39)) then
tmp = x
else if (z <= 1.95d+21) 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 <= -2.1e-39) {
tmp = x;
} else if (z <= 1.95e+21) {
tmp = (x * y) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.1e-39: tmp = x elif z <= 1.95e+21: tmp = (x * y) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.1e-39) tmp = x; elseif (z <= 1.95e+21) 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 <= -2.1e-39) tmp = x; elseif (z <= 1.95e+21) tmp = (x * y) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.1e-39], x, If[LessEqual[z, 1.95e+21], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-39}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+21}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.09999999999999993e-39 or 1.95e21 < z Initial program 70.2%
lift--.f64N/A
lift-*.f64N/A
remove-double-negN/A
lift--.f64N/A
remove-double-negN/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.9
Applied egg-rr99.9%
Taylor expanded in z around inf
Simplified55.2%
/-rgt-identity55.2
Applied egg-rr55.2%
if -2.09999999999999993e-39 < z < 1.95e21Initial program 95.4%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6466.6
Simplified66.6%
(FPCore (x y z t) :precision binary64 (if (<= z -24000000000.0) x (if (<= z 3.55e+21) (* y (/ x t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -24000000000.0) {
tmp = x;
} else if (z <= 3.55e+21) {
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 <= (-24000000000.0d0)) then
tmp = x
else if (z <= 3.55d+21) 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 <= -24000000000.0) {
tmp = x;
} else if (z <= 3.55e+21) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -24000000000.0: tmp = x elif z <= 3.55e+21: tmp = y * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -24000000000.0) tmp = x; elseif (z <= 3.55e+21) 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 <= -24000000000.0) tmp = x; elseif (z <= 3.55e+21) tmp = y * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -24000000000.0], x, If[LessEqual[z, 3.55e+21], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -24000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.55 \cdot 10^{+21}:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.4e10 or 3.55e21 < z Initial program 68.2%
lift--.f64N/A
lift-*.f64N/A
remove-double-negN/A
lift--.f64N/A
remove-double-negN/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.9
Applied egg-rr99.9%
Taylor expanded in z around inf
Simplified57.6%
/-rgt-identity57.6
Applied egg-rr57.6%
if -2.4e10 < z < 3.55e21Initial program 95.1%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6463.1
Simplified63.1%
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6461.2
Applied egg-rr61.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 82.9%
lift--.f64N/A
lift-*.f64N/A
remove-double-negN/A
lift--.f64N/A
remove-double-negN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6496.1
Applied egg-rr96.1%
Final simplification96.1%
(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 82.9%
lift--.f64N/A
lift-*.f64N/A
remove-double-negN/A
lift--.f64N/A
remove-double-negN/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6496.3
Applied egg-rr96.3%
Taylor expanded in z around inf
Simplified34.3%
/-rgt-identity34.3
Applied egg-rr34.3%
(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 2024207
(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)))