
(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 12 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 85.2%
*-commutative85.2%
associate-*l/97.2%
*-commutative97.2%
Simplified97.2%
Final simplification97.2%
(FPCore (x y z t)
:precision binary64
(if (or (<= z -8.2e+31)
(and (not (<= z -1.02e-72))
(or (<= z -1.2e-90) (not (<= z 5800000000.0)))))
(/ x (- 1.0 (/ t z)))
(* y (/ x (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8.2e+31) || (!(z <= -1.02e-72) && ((z <= -1.2e-90) || !(z <= 5800000000.0)))) {
tmp = x / (1.0 - (t / z));
} else {
tmp = y * (x / (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 ((z <= (-8.2d+31)) .or. (.not. (z <= (-1.02d-72))) .and. (z <= (-1.2d-90)) .or. (.not. (z <= 5800000000.0d0))) then
tmp = x / (1.0d0 - (t / z))
else
tmp = y * (x / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8.2e+31) || (!(z <= -1.02e-72) && ((z <= -1.2e-90) || !(z <= 5800000000.0)))) {
tmp = x / (1.0 - (t / z));
} else {
tmp = y * (x / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -8.2e+31) or (not (z <= -1.02e-72) and ((z <= -1.2e-90) or not (z <= 5800000000.0))): tmp = x / (1.0 - (t / z)) else: tmp = y * (x / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -8.2e+31) || (!(z <= -1.02e-72) && ((z <= -1.2e-90) || !(z <= 5800000000.0)))) tmp = Float64(x / Float64(1.0 - Float64(t / z))); else tmp = Float64(y * Float64(x / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -8.2e+31) || (~((z <= -1.02e-72)) && ((z <= -1.2e-90) || ~((z <= 5800000000.0))))) tmp = x / (1.0 - (t / z)); else tmp = y * (x / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8.2e+31], And[N[Not[LessEqual[z, -1.02e-72]], $MachinePrecision], Or[LessEqual[z, -1.2e-90], N[Not[LessEqual[z, 5800000000.0]], $MachinePrecision]]]], N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+31} \lor \neg \left(z \leq -1.02 \cdot 10^{-72}\right) \land \left(z \leq -1.2 \cdot 10^{-90} \lor \neg \left(z \leq 5800000000\right)\right):\\
\;\;\;\;\frac{x}{1 - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\end{array}
\end{array}
if z < -8.2000000000000003e31 or -1.02e-72 < z < -1.2000000000000001e-90 or 5.8e9 < z Initial program 77.0%
*-commutative77.0%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 63.9%
mul-1-neg63.9%
associate-/l*83.7%
distribute-neg-frac83.7%
div-sub83.8%
*-inverses83.8%
Simplified83.8%
frac-2neg83.8%
div-inv83.7%
remove-double-neg83.7%
sub-neg83.7%
metadata-eval83.7%
distribute-neg-in83.7%
metadata-eval83.7%
Applied egg-rr83.7%
associate-*r/83.8%
*-rgt-identity83.8%
+-commutative83.8%
unsub-neg83.8%
Simplified83.8%
if -8.2000000000000003e31 < z < -1.02e-72 or -1.2000000000000001e-90 < z < 5.8e9Initial program 92.8%
*-commutative92.8%
associate-*l/94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in y around inf 78.9%
associate-*l/82.3%
*-commutative82.3%
Simplified82.3%
Final simplification83.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- y z) t))))
(if (<= z -9.5e+83)
x
(if (<= z 1.1e-46)
t_1
(if (<= z 7.5) (* y (- (/ x z))) (if (<= z 3.5e+76) t_1 x))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y - z) / t);
double tmp;
if (z <= -9.5e+83) {
tmp = x;
} else if (z <= 1.1e-46) {
tmp = t_1;
} else if (z <= 7.5) {
tmp = y * -(x / z);
} else if (z <= 3.5e+76) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * ((y - z) / t)
if (z <= (-9.5d+83)) then
tmp = x
else if (z <= 1.1d-46) then
tmp = t_1
else if (z <= 7.5d0) then
tmp = y * -(x / z)
else if (z <= 3.5d+76) then
tmp = t_1
else
tmp = x
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 (z <= -9.5e+83) {
tmp = x;
} else if (z <= 1.1e-46) {
tmp = t_1;
} else if (z <= 7.5) {
tmp = y * -(x / z);
} else if (z <= 3.5e+76) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y - z) / t) tmp = 0 if z <= -9.5e+83: tmp = x elif z <= 1.1e-46: tmp = t_1 elif z <= 7.5: tmp = y * -(x / z) elif z <= 3.5e+76: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y - z) / t)) tmp = 0.0 if (z <= -9.5e+83) tmp = x; elseif (z <= 1.1e-46) tmp = t_1; elseif (z <= 7.5) tmp = Float64(y * Float64(-Float64(x / z))); elseif (z <= 3.5e+76) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y - z) / t); tmp = 0.0; if (z <= -9.5e+83) tmp = x; elseif (z <= 1.1e-46) tmp = t_1; elseif (z <= 7.5) tmp = y * -(x / z); elseif (z <= 3.5e+76) tmp = t_1; else tmp = x; 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[z, -9.5e+83], x, If[LessEqual[z, 1.1e-46], t$95$1, If[LessEqual[z, 7.5], N[(y * (-N[(x / z), $MachinePrecision])), $MachinePrecision], If[LessEqual[z, 3.5e+76], t$95$1, x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y - z}{t}\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+83}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 7.5:\\
\;\;\;\;y \cdot \left(-\frac{x}{z}\right)\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+76}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -9.5000000000000002e83 or 3.5e76 < z Initial program 72.9%
*-commutative72.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 70.8%
if -9.5000000000000002e83 < z < 1.1e-46 or 7.5 < z < 3.5e76Initial program 91.8%
*-commutative91.8%
associate-*l/95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in t around inf 77.2%
if 1.1e-46 < z < 7.5Initial program 99.5%
*-commutative99.5%
associate-*l/99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in y around inf 81.2%
Taylor expanded in t around 0 71.5%
associate-*r/71.5%
mul-1-neg71.5%
distribute-rgt-neg-in71.5%
Simplified71.5%
Taylor expanded in x around 0 71.5%
mul-1-neg71.5%
associate-*l/71.7%
*-commutative71.7%
Simplified71.7%
Final simplification74.6%
(FPCore (x y z t)
:precision binary64
(if (<= z -3.8e+45)
x
(if (<= z -2.3e-100)
(* x (/ (- z) t))
(if (<= z 3.2e-57) (/ y (/ t x)) (if (<= z 8.5) (* y (- (/ x z))) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.8e+45) {
tmp = x;
} else if (z <= -2.3e-100) {
tmp = x * (-z / t);
} else if (z <= 3.2e-57) {
tmp = y / (t / x);
} else if (z <= 8.5) {
tmp = y * -(x / 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 <= (-3.8d+45)) then
tmp = x
else if (z <= (-2.3d-100)) then
tmp = x * (-z / t)
else if (z <= 3.2d-57) then
tmp = y / (t / x)
else if (z <= 8.5d0) then
tmp = y * -(x / 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 <= -3.8e+45) {
tmp = x;
} else if (z <= -2.3e-100) {
tmp = x * (-z / t);
} else if (z <= 3.2e-57) {
tmp = y / (t / x);
} else if (z <= 8.5) {
tmp = y * -(x / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.8e+45: tmp = x elif z <= -2.3e-100: tmp = x * (-z / t) elif z <= 3.2e-57: tmp = y / (t / x) elif z <= 8.5: tmp = y * -(x / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.8e+45) tmp = x; elseif (z <= -2.3e-100) tmp = Float64(x * Float64(Float64(-z) / t)); elseif (z <= 3.2e-57) tmp = Float64(y / Float64(t / x)); elseif (z <= 8.5) tmp = Float64(y * Float64(-Float64(x / z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.8e+45) tmp = x; elseif (z <= -2.3e-100) tmp = x * (-z / t); elseif (z <= 3.2e-57) tmp = y / (t / x); elseif (z <= 8.5) tmp = y * -(x / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.8e+45], x, If[LessEqual[z, -2.3e-100], N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e-57], N[(y / N[(t / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5], N[(y * (-N[(x / z), $MachinePrecision])), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+45}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-100}:\\
\;\;\;\;x \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-57}:\\
\;\;\;\;\frac{y}{\frac{t}{x}}\\
\mathbf{elif}\;z \leq 8.5:\\
\;\;\;\;y \cdot \left(-\frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.8000000000000002e45 or 8.5 < z Initial program 75.3%
*-commutative75.3%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 63.7%
if -3.8000000000000002e45 < z < -2.29999999999999994e-100Initial program 96.6%
*-commutative96.6%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 65.0%
Taylor expanded in y around 0 45.1%
neg-mul-145.1%
distribute-neg-frac45.1%
Simplified45.1%
if -2.29999999999999994e-100 < z < 3.2000000000000001e-57Initial program 91.6%
*-commutative91.6%
associate-*l/94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in z around 0 78.3%
associate-*r/76.8%
*-commutative76.8%
associate-/l*81.3%
Applied egg-rr81.3%
if 3.2000000000000001e-57 < z < 8.5Initial program 99.6%
*-commutative99.6%
associate-*l/90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in y around inf 74.0%
Taylor expanded in t around 0 65.3%
associate-*r/65.3%
mul-1-neg65.3%
distribute-rgt-neg-in65.3%
Simplified65.3%
Taylor expanded in x around 0 65.3%
mul-1-neg65.3%
associate-*l/65.4%
*-commutative65.4%
Simplified65.4%
Final simplification68.8%
(FPCore (x y z t)
:precision binary64
(if (<= z -3.8e+45)
x
(if (<= z -1.4e-100)
(/ z (/ (- t) x))
(if (<= z 5e-57) (/ y (/ t x)) (if (<= z 7.2) (* y (- (/ x z))) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.8e+45) {
tmp = x;
} else if (z <= -1.4e-100) {
tmp = z / (-t / x);
} else if (z <= 5e-57) {
tmp = y / (t / x);
} else if (z <= 7.2) {
tmp = y * -(x / 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 <= (-3.8d+45)) then
tmp = x
else if (z <= (-1.4d-100)) then
tmp = z / (-t / x)
else if (z <= 5d-57) then
tmp = y / (t / x)
else if (z <= 7.2d0) then
tmp = y * -(x / 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 <= -3.8e+45) {
tmp = x;
} else if (z <= -1.4e-100) {
tmp = z / (-t / x);
} else if (z <= 5e-57) {
tmp = y / (t / x);
} else if (z <= 7.2) {
tmp = y * -(x / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.8e+45: tmp = x elif z <= -1.4e-100: tmp = z / (-t / x) elif z <= 5e-57: tmp = y / (t / x) elif z <= 7.2: tmp = y * -(x / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.8e+45) tmp = x; elseif (z <= -1.4e-100) tmp = Float64(z / Float64(Float64(-t) / x)); elseif (z <= 5e-57) tmp = Float64(y / Float64(t / x)); elseif (z <= 7.2) tmp = Float64(y * Float64(-Float64(x / z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.8e+45) tmp = x; elseif (z <= -1.4e-100) tmp = z / (-t / x); elseif (z <= 5e-57) tmp = y / (t / x); elseif (z <= 7.2) tmp = y * -(x / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.8e+45], x, If[LessEqual[z, -1.4e-100], N[(z / N[((-t) / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-57], N[(y / N[(t / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2], N[(y * (-N[(x / z), $MachinePrecision])), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+45}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-100}:\\
\;\;\;\;\frac{z}{\frac{-t}{x}}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-57}:\\
\;\;\;\;\frac{y}{\frac{t}{x}}\\
\mathbf{elif}\;z \leq 7.2:\\
\;\;\;\;y \cdot \left(-\frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.8000000000000002e45 or 7.20000000000000018 < z Initial program 75.3%
*-commutative75.3%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 63.7%
if -3.8000000000000002e45 < z < -1.39999999999999998e-100Initial program 96.6%
*-commutative96.6%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 65.0%
Taylor expanded in y around 0 45.1%
neg-mul-145.1%
distribute-neg-frac45.1%
Simplified45.1%
*-commutative45.1%
div-inv45.2%
associate-*l*45.2%
add-sqr-sqrt45.1%
sqrt-unprod45.2%
sqr-neg45.2%
sqrt-unprod0.0%
add-sqr-sqrt13.8%
associate-/r/13.8%
div-inv13.8%
frac-2neg13.8%
add-sqr-sqrt13.8%
sqrt-unprod13.8%
sqr-neg13.8%
sqrt-unprod0.0%
add-sqr-sqrt45.2%
distribute-neg-frac45.2%
Applied egg-rr45.2%
if -1.39999999999999998e-100 < z < 5.0000000000000002e-57Initial program 91.6%
*-commutative91.6%
associate-*l/94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in z around 0 78.3%
associate-*r/76.8%
*-commutative76.8%
associate-/l*81.3%
Applied egg-rr81.3%
if 5.0000000000000002e-57 < z < 7.20000000000000018Initial program 99.6%
*-commutative99.6%
associate-*l/90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in y around inf 74.0%
Taylor expanded in t around 0 65.3%
associate-*r/65.3%
mul-1-neg65.3%
distribute-rgt-neg-in65.3%
Simplified65.3%
Taylor expanded in x around 0 65.3%
mul-1-neg65.3%
associate-*l/65.4%
*-commutative65.4%
Simplified65.4%
Final simplification68.8%
(FPCore (x y z t)
:precision binary64
(if (<= z -3.8e+45)
x
(if (<= z -2.3e-100)
(/ (- x) (/ t z))
(if (<= z 3.8e-57) (/ y (/ t x)) (if (<= z 6.5) (* y (- (/ x z))) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.8e+45) {
tmp = x;
} else if (z <= -2.3e-100) {
tmp = -x / (t / z);
} else if (z <= 3.8e-57) {
tmp = y / (t / x);
} else if (z <= 6.5) {
tmp = y * -(x / 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 <= (-3.8d+45)) then
tmp = x
else if (z <= (-2.3d-100)) then
tmp = -x / (t / z)
else if (z <= 3.8d-57) then
tmp = y / (t / x)
else if (z <= 6.5d0) then
tmp = y * -(x / 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 <= -3.8e+45) {
tmp = x;
} else if (z <= -2.3e-100) {
tmp = -x / (t / z);
} else if (z <= 3.8e-57) {
tmp = y / (t / x);
} else if (z <= 6.5) {
tmp = y * -(x / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.8e+45: tmp = x elif z <= -2.3e-100: tmp = -x / (t / z) elif z <= 3.8e-57: tmp = y / (t / x) elif z <= 6.5: tmp = y * -(x / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.8e+45) tmp = x; elseif (z <= -2.3e-100) tmp = Float64(Float64(-x) / Float64(t / z)); elseif (z <= 3.8e-57) tmp = Float64(y / Float64(t / x)); elseif (z <= 6.5) tmp = Float64(y * Float64(-Float64(x / z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.8e+45) tmp = x; elseif (z <= -2.3e-100) tmp = -x / (t / z); elseif (z <= 3.8e-57) tmp = y / (t / x); elseif (z <= 6.5) tmp = y * -(x / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.8e+45], x, If[LessEqual[z, -2.3e-100], N[((-x) / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-57], N[(y / N[(t / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5], N[(y * (-N[(x / z), $MachinePrecision])), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+45}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-100}:\\
\;\;\;\;\frac{-x}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-57}:\\
\;\;\;\;\frac{y}{\frac{t}{x}}\\
\mathbf{elif}\;z \leq 6.5:\\
\;\;\;\;y \cdot \left(-\frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.8000000000000002e45 or 6.5 < z Initial program 75.3%
*-commutative75.3%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 63.7%
if -3.8000000000000002e45 < z < -2.29999999999999994e-100Initial program 96.6%
*-commutative96.6%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 65.0%
Taylor expanded in y around 0 45.3%
mul-1-neg45.3%
associate-/l*45.3%
distribute-neg-frac45.3%
Simplified45.3%
if -2.29999999999999994e-100 < z < 3.7999999999999997e-57Initial program 91.6%
*-commutative91.6%
associate-*l/94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in z around 0 78.3%
associate-*r/76.8%
*-commutative76.8%
associate-/l*81.3%
Applied egg-rr81.3%
if 3.7999999999999997e-57 < z < 6.5Initial program 99.6%
*-commutative99.6%
associate-*l/90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in y around inf 74.0%
Taylor expanded in t around 0 65.3%
associate-*r/65.3%
mul-1-neg65.3%
distribute-rgt-neg-in65.3%
Simplified65.3%
Taylor expanded in x around 0 65.3%
mul-1-neg65.3%
associate-*l/65.4%
*-commutative65.4%
Simplified65.4%
Final simplification68.8%
(FPCore (x y z t)
:precision binary64
(if (<= z -3.1e+82)
x
(if (<= z -2.6e-95)
(* x (/ (- y z) t))
(if (<= z 8300000000.0) (* y (/ x (- t z))) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.1e+82) {
tmp = x;
} else if (z <= -2.6e-95) {
tmp = x * ((y - z) / t);
} else if (z <= 8300000000.0) {
tmp = y * (x / (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 <= (-3.1d+82)) then
tmp = x
else if (z <= (-2.6d-95)) then
tmp = x * ((y - z) / t)
else if (z <= 8300000000.0d0) then
tmp = y * (x / (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 <= -3.1e+82) {
tmp = x;
} else if (z <= -2.6e-95) {
tmp = x * ((y - z) / t);
} else if (z <= 8300000000.0) {
tmp = y * (x / (t - z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.1e+82: tmp = x elif z <= -2.6e-95: tmp = x * ((y - z) / t) elif z <= 8300000000.0: tmp = y * (x / (t - z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.1e+82) tmp = x; elseif (z <= -2.6e-95) tmp = Float64(x * Float64(Float64(y - z) / t)); elseif (z <= 8300000000.0) tmp = Float64(y * Float64(x / Float64(t - z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.1e+82) tmp = x; elseif (z <= -2.6e-95) tmp = x * ((y - z) / t); elseif (z <= 8300000000.0) tmp = y * (x / (t - z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.1e+82], x, If[LessEqual[z, -2.6e-95], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8300000000.0], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+82}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-95}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\mathbf{elif}\;z \leq 8300000000:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.10000000000000032e82 or 8.3e9 < z Initial program 73.2%
*-commutative73.2%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 67.4%
if -3.10000000000000032e82 < z < -2.60000000000000001e-95Initial program 94.8%
*-commutative94.8%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 63.1%
if -2.60000000000000001e-95 < z < 8.3e9Initial program 92.6%
*-commutative92.6%
associate-*l/94.0%
*-commutative94.0%
Simplified94.0%
Taylor expanded in y around inf 80.6%
associate-*l/83.7%
*-commutative83.7%
Simplified83.7%
Final simplification74.2%
(FPCore (x y z t) :precision binary64 (if (<= z -3.8e+45) x (if (<= z 4.7e-45) (/ x (/ t y)) (if (<= z 3.8) (* y (- (/ x z))) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.8e+45) {
tmp = x;
} else if (z <= 4.7e-45) {
tmp = x / (t / y);
} else if (z <= 3.8) {
tmp = y * -(x / 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 <= (-3.8d+45)) then
tmp = x
else if (z <= 4.7d-45) then
tmp = x / (t / y)
else if (z <= 3.8d0) then
tmp = y * -(x / 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 <= -3.8e+45) {
tmp = x;
} else if (z <= 4.7e-45) {
tmp = x / (t / y);
} else if (z <= 3.8) {
tmp = y * -(x / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.8e+45: tmp = x elif z <= 4.7e-45: tmp = x / (t / y) elif z <= 3.8: tmp = y * -(x / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.8e+45) tmp = x; elseif (z <= 4.7e-45) tmp = Float64(x / Float64(t / y)); elseif (z <= 3.8) tmp = Float64(y * Float64(-Float64(x / z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.8e+45) tmp = x; elseif (z <= 4.7e-45) tmp = x / (t / y); elseif (z <= 3.8) tmp = y * -(x / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.8e+45], x, If[LessEqual[z, 4.7e-45], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8], N[(y * (-N[(x / z), $MachinePrecision])), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+45}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-45}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 3.8:\\
\;\;\;\;y \cdot \left(-\frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.8000000000000002e45 or 3.7999999999999998 < z Initial program 75.3%
*-commutative75.3%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 63.7%
if -3.8000000000000002e45 < z < 4.6999999999999998e-45Initial program 92.7%
*-commutative92.7%
associate-*l/94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in z around 0 66.0%
associate-/l*69.8%
Simplified69.8%
if 4.6999999999999998e-45 < z < 3.7999999999999998Initial program 99.5%
*-commutative99.5%
associate-*l/99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in y around inf 81.2%
Taylor expanded in t around 0 71.5%
associate-*r/71.5%
mul-1-neg71.5%
distribute-rgt-neg-in71.5%
Simplified71.5%
Taylor expanded in x around 0 71.5%
mul-1-neg71.5%
associate-*l/71.7%
*-commutative71.7%
Simplified71.7%
Final simplification67.1%
(FPCore (x y z t) :precision binary64 (if (<= z -3.8e+45) x (if (<= z 2.1e-16) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.8e+45) {
tmp = x;
} else if (z <= 2.1e-16) {
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 <= (-3.8d+45)) then
tmp = x
else if (z <= 2.1d-16) 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 <= -3.8e+45) {
tmp = x;
} else if (z <= 2.1e-16) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.8e+45: tmp = x elif z <= 2.1e-16: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.8e+45) tmp = x; elseif (z <= 2.1e-16) 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 <= -3.8e+45) tmp = x; elseif (z <= 2.1e-16) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.8e+45], x, If[LessEqual[z, 2.1e-16], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+45}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-16}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.8000000000000002e45 or 2.1000000000000001e-16 < z Initial program 76.9%
*-commutative76.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 61.3%
if -3.8000000000000002e45 < z < 2.1000000000000001e-16Initial program 92.8%
*-commutative92.8%
associate-*l/94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in z around 0 67.6%
Final simplification64.6%
(FPCore (x y z t) :precision binary64 (if (<= z -3.8e+45) x (if (<= z 3.4e-16) (* y (/ x t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.8e+45) {
tmp = x;
} else if (z <= 3.4e-16) {
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 <= (-3.8d+45)) then
tmp = x
else if (z <= 3.4d-16) 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 <= -3.8e+45) {
tmp = x;
} else if (z <= 3.4e-16) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.8e+45: tmp = x elif z <= 3.4e-16: tmp = y * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.8e+45) tmp = x; elseif (z <= 3.4e-16) 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 <= -3.8e+45) tmp = x; elseif (z <= 3.4e-16) tmp = y * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.8e+45], x, If[LessEqual[z, 3.4e-16], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+45}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-16}:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.8000000000000002e45 or 3.4e-16 < z Initial program 76.9%
*-commutative76.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 61.3%
if -3.8000000000000002e45 < z < 3.4e-16Initial program 92.8%
*-commutative92.8%
associate-*l/94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in z around 0 65.8%
associate-/l*69.5%
Simplified69.5%
associate-/r/69.2%
Applied egg-rr69.2%
Final simplification65.4%
(FPCore (x y z t) :precision binary64 (if (<= z -3.8e+45) x (if (<= z 3.7e-16) (/ x (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.8e+45) {
tmp = x;
} else if (z <= 3.7e-16) {
tmp = x / (t / y);
} 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 <= (-3.8d+45)) then
tmp = x
else if (z <= 3.7d-16) then
tmp = x / (t / y)
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 <= -3.8e+45) {
tmp = x;
} else if (z <= 3.7e-16) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.8e+45: tmp = x elif z <= 3.7e-16: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.8e+45) tmp = x; elseif (z <= 3.7e-16) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.8e+45) tmp = x; elseif (z <= 3.7e-16) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.8e+45], x, If[LessEqual[z, 3.7e-16], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+45}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.8000000000000002e45 or 3.7e-16 < z Initial program 76.9%
*-commutative76.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 61.3%
if -3.8000000000000002e45 < z < 3.7e-16Initial program 92.8%
*-commutative92.8%
associate-*l/94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in z around 0 65.8%
associate-/l*69.5%
Simplified69.5%
Final simplification65.5%
(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 85.2%
*-commutative85.2%
associate-*l/97.2%
*-commutative97.2%
Simplified97.2%
Taylor expanded in z around inf 34.9%
Final simplification34.9%
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((t - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(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 2024011
(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)))