
(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 8 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 (/ (- 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-*r/96.4%
Simplified96.4%
Final simplification96.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.6e-52)
(/ x (/ (- t z) y))
(if (<= y 5.4e-81)
(/ (- z) (/ (- t z) x))
(if (<= y 6.2e-27)
(/ (- y z) (/ t x))
(if (<= y 28000000.0) x (* x (/ y (- t z))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.6e-52) {
tmp = x / ((t - z) / y);
} else if (y <= 5.4e-81) {
tmp = -z / ((t - z) / x);
} else if (y <= 6.2e-27) {
tmp = (y - z) / (t / x);
} else if (y <= 28000000.0) {
tmp = x;
} else {
tmp = x * (y / (t - 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 <= (-3.6d-52)) then
tmp = x / ((t - z) / y)
else if (y <= 5.4d-81) then
tmp = -z / ((t - z) / x)
else if (y <= 6.2d-27) then
tmp = (y - z) / (t / x)
else if (y <= 28000000.0d0) then
tmp = x
else
tmp = x * (y / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.6e-52) {
tmp = x / ((t - z) / y);
} else if (y <= 5.4e-81) {
tmp = -z / ((t - z) / x);
} else if (y <= 6.2e-27) {
tmp = (y - z) / (t / x);
} else if (y <= 28000000.0) {
tmp = x;
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.6e-52: tmp = x / ((t - z) / y) elif y <= 5.4e-81: tmp = -z / ((t - z) / x) elif y <= 6.2e-27: tmp = (y - z) / (t / x) elif y <= 28000000.0: tmp = x else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.6e-52) tmp = Float64(x / Float64(Float64(t - z) / y)); elseif (y <= 5.4e-81) tmp = Float64(Float64(-z) / Float64(Float64(t - z) / x)); elseif (y <= 6.2e-27) tmp = Float64(Float64(y - z) / Float64(t / x)); elseif (y <= 28000000.0) tmp = x; else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.6e-52) tmp = x / ((t - z) / y); elseif (y <= 5.4e-81) tmp = -z / ((t - z) / x); elseif (y <= 6.2e-27) tmp = (y - z) / (t / x); elseif (y <= 28000000.0) tmp = x; else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.6e-52], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.4e-81], N[((-z) / N[(N[(t - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e-27], N[(N[(y - z), $MachinePrecision] / N[(t / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 28000000.0], x, N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{-52}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-81}:\\
\;\;\;\;\frac{-z}{\frac{t - z}{x}}\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-27}:\\
\;\;\;\;\frac{y - z}{\frac{t}{x}}\\
\mathbf{elif}\;y \leq 28000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if y < -3.59999999999999988e-52Initial program 86.7%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in y around inf 76.6%
if -3.59999999999999988e-52 < y < 5.39999999999999979e-81Initial program 85.0%
associate-/l*91.4%
Simplified91.4%
associate-/l*85.0%
clear-num84.9%
associate-/r/84.9%
Applied egg-rr84.9%
Taylor expanded in y around 0 74.1%
mul-1-neg74.1%
associate-/l*73.6%
Simplified73.6%
if 5.39999999999999979e-81 < y < 6.1999999999999997e-27Initial program 99.6%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in t around inf 72.8%
associate-/l*73.0%
Simplified73.0%
if 6.1999999999999997e-27 < y < 2.8e7Initial program 86.2%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in z around inf 72.4%
if 2.8e7 < y Initial program 86.1%
associate-*r/98.2%
Simplified98.2%
Taylor expanded in y around inf 84.5%
Final simplification76.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.15e+105)
x
(if (<= z 1.6e-165)
(* x (/ y (- t z)))
(if (<= z 2.6e+23) (/ (* x (- y z)) t) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.15e+105) {
tmp = x;
} else if (z <= 1.6e-165) {
tmp = x * (y / (t - z));
} else if (z <= 2.6e+23) {
tmp = (x * (y - z)) / 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.15d+105)) then
tmp = x
else if (z <= 1.6d-165) then
tmp = x * (y / (t - z))
else if (z <= 2.6d+23) then
tmp = (x * (y - z)) / 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.15e+105) {
tmp = x;
} else if (z <= 1.6e-165) {
tmp = x * (y / (t - z));
} else if (z <= 2.6e+23) {
tmp = (x * (y - z)) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.15e+105: tmp = x elif z <= 1.6e-165: tmp = x * (y / (t - z)) elif z <= 2.6e+23: tmp = (x * (y - z)) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.15e+105) tmp = x; elseif (z <= 1.6e-165) tmp = Float64(x * Float64(y / Float64(t - z))); elseif (z <= 2.6e+23) tmp = Float64(Float64(x * Float64(y - z)) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.15e+105) tmp = x; elseif (z <= 1.6e-165) tmp = x * (y / (t - z)); elseif (z <= 2.6e+23) tmp = (x * (y - z)) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.15e+105], x, If[LessEqual[z, 1.6e-165], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e+23], N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+105}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-165}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+23}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.1499999999999999e105 or 2.59999999999999992e23 < z Initial program 77.9%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 66.8%
if -1.1499999999999999e105 < z < 1.60000000000000006e-165Initial program 89.5%
associate-*r/94.4%
Simplified94.4%
Taylor expanded in y around inf 78.5%
if 1.60000000000000006e-165 < z < 2.59999999999999992e23Initial program 97.3%
associate-*r/94.3%
Simplified94.3%
Taylor expanded in t around inf 78.3%
Final simplification74.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -5.6e+102)
x
(if (<= z 3.4e-236)
(* x (/ y (- t z)))
(if (<= z 1.5e+20) (/ (- y z) (/ t x)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.6e+102) {
tmp = x;
} else if (z <= 3.4e-236) {
tmp = x * (y / (t - z));
} else if (z <= 1.5e+20) {
tmp = (y - z) / (t / x);
} 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.6d+102)) then
tmp = x
else if (z <= 3.4d-236) then
tmp = x * (y / (t - z))
else if (z <= 1.5d+20) then
tmp = (y - z) / (t / x)
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.6e+102) {
tmp = x;
} else if (z <= 3.4e-236) {
tmp = x * (y / (t - z));
} else if (z <= 1.5e+20) {
tmp = (y - z) / (t / x);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.6e+102: tmp = x elif z <= 3.4e-236: tmp = x * (y / (t - z)) elif z <= 1.5e+20: tmp = (y - z) / (t / x) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.6e+102) tmp = x; elseif (z <= 3.4e-236) tmp = Float64(x * Float64(y / Float64(t - z))); elseif (z <= 1.5e+20) tmp = Float64(Float64(y - z) / Float64(t / x)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.6e+102) tmp = x; elseif (z <= 3.4e-236) tmp = x * (y / (t - z)); elseif (z <= 1.5e+20) tmp = (y - z) / (t / x); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.6e+102], x, If[LessEqual[z, 3.4e-236], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+20], N[(N[(y - z), $MachinePrecision] / N[(t / x), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-236}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+20}:\\
\;\;\;\;\frac{y - z}{\frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.60000000000000037e102 or 1.5e20 < z Initial program 77.9%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 66.8%
if -5.60000000000000037e102 < z < 3.3999999999999998e-236Initial program 90.0%
associate-*r/96.0%
Simplified96.0%
Taylor expanded in y around inf 76.5%
if 3.3999999999999998e-236 < z < 1.5e20Initial program 93.5%
associate-*r/91.5%
Simplified91.5%
Taylor expanded in t around inf 78.5%
associate-/l*83.2%
Simplified83.2%
Final simplification74.5%
(FPCore (x y z t) :precision binary64 (if (<= y -2.7e-46) (/ x (/ (- t z) y)) (if (<= y 1.26e+23) (* x (/ (- z) (- t z))) (* x (/ y (- t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.7e-46) {
tmp = x / ((t - z) / y);
} else if (y <= 1.26e+23) {
tmp = x * (-z / (t - z));
} else {
tmp = x * (y / (t - 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.7d-46)) then
tmp = x / ((t - z) / y)
else if (y <= 1.26d+23) then
tmp = x * (-z / (t - z))
else
tmp = x * (y / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.7e-46) {
tmp = x / ((t - z) / y);
} else if (y <= 1.26e+23) {
tmp = x * (-z / (t - z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.7e-46: tmp = x / ((t - z) / y) elif y <= 1.26e+23: tmp = x * (-z / (t - z)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.7e-46) tmp = Float64(x / Float64(Float64(t - z) / y)); elseif (y <= 1.26e+23) tmp = Float64(x * Float64(Float64(-z) / Float64(t - z))); else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.7e-46) tmp = x / ((t - z) / y); elseif (y <= 1.26e+23) tmp = x * (-z / (t - z)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.7e-46], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.26e+23], N[(x * N[((-z) / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-46}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{elif}\;y \leq 1.26 \cdot 10^{+23}:\\
\;\;\;\;x \cdot \frac{-z}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if y < -2.7e-46Initial program 86.7%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in y around inf 76.6%
if -2.7e-46 < y < 1.26000000000000004e23Initial program 86.5%
associate-*r/94.7%
Simplified94.7%
Taylor expanded in y around 0 80.4%
neg-mul-180.4%
distribute-neg-frac80.4%
Simplified80.4%
if 1.26000000000000004e23 < y Initial program 85.6%
associate-*r/98.2%
Simplified98.2%
Taylor expanded in y around inf 85.6%
Final simplification80.7%
(FPCore (x y z t) :precision binary64 (if (<= z -1.1e+105) x (if (<= z 3e+99) (* x (/ y (- t z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.1e+105) {
tmp = x;
} else if (z <= 3e+99) {
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 <= (-1.1d+105)) then
tmp = x
else if (z <= 3d+99) 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 <= -1.1e+105) {
tmp = x;
} else if (z <= 3e+99) {
tmp = x * (y / (t - z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.1e+105: tmp = x elif z <= 3e+99: tmp = x * (y / (t - z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.1e+105) tmp = x; elseif (z <= 3e+99) 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 <= -1.1e+105) tmp = x; elseif (z <= 3e+99) tmp = x * (y / (t - z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.1e+105], x, If[LessEqual[z, 3e+99], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+105}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+99}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.10000000000000003e105 or 3.00000000000000014e99 < z Initial program 75.8%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 70.4%
if -1.10000000000000003e105 < z < 3.00000000000000014e99Initial program 91.3%
associate-*r/94.7%
Simplified94.7%
Taylor expanded in y around inf 72.8%
Final simplification72.1%
(FPCore (x y z t) :precision binary64 (if (<= z -4.1e+96) x (if (<= z 5.4e+17) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.1e+96) {
tmp = x;
} else if (z <= 5.4e+17) {
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 <= (-4.1d+96)) then
tmp = x
else if (z <= 5.4d+17) 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 <= -4.1e+96) {
tmp = x;
} else if (z <= 5.4e+17) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.1e+96: tmp = x elif z <= 5.4e+17: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.1e+96) tmp = x; elseif (z <= 5.4e+17) 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 <= -4.1e+96) tmp = x; elseif (z <= 5.4e+17) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.1e+96], x, If[LessEqual[z, 5.4e+17], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+96}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+17}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.09999999999999998e96 or 5.4e17 < z Initial program 78.1%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 66.2%
if -4.09999999999999998e96 < z < 5.4e17Initial program 91.2%
associate-*r/94.3%
Simplified94.3%
Taylor expanded in z around 0 67.9%
Final simplification67.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 86.3%
associate-*r/96.4%
Simplified96.4%
Taylor expanded in z around inf 34.5%
Final simplification34.5%
(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 2023187
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:herbie-target
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))