
(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 (/ (- 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.8%
associate-/l*97.2%
Simplified97.2%
Final simplification97.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))))
(if (<= z -3.8e+86)
t_1
(if (<= z -110000.0)
(/ (- y z) (/ t x))
(if (<= z -2.15e-82)
t_1
(if (<= z 34.0) (/ x (/ (- t z) y)) (/ (- x) (+ (/ t z) -1.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -3.8e+86) {
tmp = t_1;
} else if (z <= -110000.0) {
tmp = (y - z) / (t / x);
} else if (z <= -2.15e-82) {
tmp = t_1;
} else if (z <= 34.0) {
tmp = x / ((t - z) / y);
} else {
tmp = -x / ((t / z) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (1.0d0 - (y / z))
if (z <= (-3.8d+86)) then
tmp = t_1
else if (z <= (-110000.0d0)) then
tmp = (y - z) / (t / x)
else if (z <= (-2.15d-82)) then
tmp = t_1
else if (z <= 34.0d0) then
tmp = x / ((t - z) / y)
else
tmp = -x / ((t / z) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -3.8e+86) {
tmp = t_1;
} else if (z <= -110000.0) {
tmp = (y - z) / (t / x);
} else if (z <= -2.15e-82) {
tmp = t_1;
} else if (z <= 34.0) {
tmp = x / ((t - z) / y);
} else {
tmp = -x / ((t / z) + -1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if z <= -3.8e+86: tmp = t_1 elif z <= -110000.0: tmp = (y - z) / (t / x) elif z <= -2.15e-82: tmp = t_1 elif z <= 34.0: tmp = x / ((t - z) / y) else: tmp = -x / ((t / z) + -1.0) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -3.8e+86) tmp = t_1; elseif (z <= -110000.0) tmp = Float64(Float64(y - z) / Float64(t / x)); elseif (z <= -2.15e-82) tmp = t_1; elseif (z <= 34.0) tmp = Float64(x / Float64(Float64(t - z) / y)); else tmp = Float64(Float64(-x) / Float64(Float64(t / z) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / z)); tmp = 0.0; if (z <= -3.8e+86) tmp = t_1; elseif (z <= -110000.0) tmp = (y - z) / (t / x); elseif (z <= -2.15e-82) tmp = t_1; elseif (z <= 34.0) tmp = x / ((t - z) / y); else tmp = -x / ((t / z) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e+86], t$95$1, If[LessEqual[z, -110000.0], N[(N[(y - z), $MachinePrecision] / N[(t / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.15e-82], t$95$1, If[LessEqual[z, 34.0], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[((-x) / N[(N[(t / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+86}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -110000:\\
\;\;\;\;\frac{y - z}{\frac{t}{x}}\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{-82}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 34:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\frac{t}{z} + -1}\\
\end{array}
\end{array}
if z < -3.79999999999999978e86 or -1.1e5 < z < -2.15000000000000009e-82Initial program 86.8%
associate-*r/98.1%
Simplified98.1%
div-sub98.1%
Applied egg-rr98.1%
Taylor expanded in t around 0 77.5%
mul-1-neg77.5%
sub-neg77.5%
Simplified77.5%
if -3.79999999999999978e86 < z < -1.1e5Initial program 74.2%
associate-*r/99.4%
Simplified99.4%
associate-*r/74.2%
*-commutative74.2%
associate-/l*94.8%
Applied egg-rr94.8%
Taylor expanded in t around inf 73.5%
if -2.15000000000000009e-82 < z < 34Initial program 89.8%
associate-/l*94.3%
Simplified94.3%
Taylor expanded in y around inf 79.4%
if 34 < z Initial program 72.0%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 55.9%
mul-1-neg55.9%
associate-/l*78.0%
distribute-neg-frac78.0%
div-sub78.1%
sub-neg78.1%
*-inverses78.1%
metadata-eval78.1%
Simplified78.1%
Final simplification78.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- x) (/ z (- y z)))))
(if (<= z -3.3e+86)
t_1
(if (<= z -26000.0)
(/ (- y z) (/ t x))
(if (<= z -4.2e-78)
t_1
(if (<= z 0.28) (/ x (/ (- t z) y)) (/ (- x) (+ (/ t z) -1.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = -x / (z / (y - z));
double tmp;
if (z <= -3.3e+86) {
tmp = t_1;
} else if (z <= -26000.0) {
tmp = (y - z) / (t / x);
} else if (z <= -4.2e-78) {
tmp = t_1;
} else if (z <= 0.28) {
tmp = x / ((t - z) / y);
} else {
tmp = -x / ((t / z) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = -x / (z / (y - z))
if (z <= (-3.3d+86)) then
tmp = t_1
else if (z <= (-26000.0d0)) then
tmp = (y - z) / (t / x)
else if (z <= (-4.2d-78)) then
tmp = t_1
else if (z <= 0.28d0) then
tmp = x / ((t - z) / y)
else
tmp = -x / ((t / z) + (-1.0d0))
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 <= -3.3e+86) {
tmp = t_1;
} else if (z <= -26000.0) {
tmp = (y - z) / (t / x);
} else if (z <= -4.2e-78) {
tmp = t_1;
} else if (z <= 0.28) {
tmp = x / ((t - z) / y);
} else {
tmp = -x / ((t / z) + -1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = -x / (z / (y - z)) tmp = 0 if z <= -3.3e+86: tmp = t_1 elif z <= -26000.0: tmp = (y - z) / (t / x) elif z <= -4.2e-78: tmp = t_1 elif z <= 0.28: tmp = x / ((t - z) / y) else: tmp = -x / ((t / z) + -1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-x) / Float64(z / Float64(y - z))) tmp = 0.0 if (z <= -3.3e+86) tmp = t_1; elseif (z <= -26000.0) tmp = Float64(Float64(y - z) / Float64(t / x)); elseif (z <= -4.2e-78) tmp = t_1; elseif (z <= 0.28) tmp = Float64(x / Float64(Float64(t - z) / y)); else tmp = Float64(Float64(-x) / Float64(Float64(t / z) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -x / (z / (y - z)); tmp = 0.0; if (z <= -3.3e+86) tmp = t_1; elseif (z <= -26000.0) tmp = (y - z) / (t / x); elseif (z <= -4.2e-78) tmp = t_1; elseif (z <= 0.28) tmp = x / ((t - z) / y); else tmp = -x / ((t / z) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-x) / N[(z / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.3e+86], t$95$1, If[LessEqual[z, -26000.0], N[(N[(y - z), $MachinePrecision] / N[(t / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.2e-78], t$95$1, If[LessEqual[z, 0.28], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[((-x) / N[(N[(t / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-x}{\frac{z}{y - z}}\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{+86}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -26000:\\
\;\;\;\;\frac{y - z}{\frac{t}{x}}\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-78}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 0.28:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\frac{t}{z} + -1}\\
\end{array}
\end{array}
if z < -3.2999999999999999e86 or -26000 < z < -4.2000000000000001e-78Initial program 86.5%
associate-*r/98.1%
Simplified98.1%
Taylor expanded in t around 0 67.1%
mul-1-neg67.1%
associate-/l*77.2%
distribute-neg-frac77.2%
Simplified77.2%
if -3.2999999999999999e86 < z < -26000Initial program 74.2%
associate-*r/99.4%
Simplified99.4%
associate-*r/74.2%
*-commutative74.2%
associate-/l*94.8%
Applied egg-rr94.8%
Taylor expanded in t around inf 73.5%
if -4.2000000000000001e-78 < z < 0.28000000000000003Initial program 89.8%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in y around inf 79.5%
if 0.28000000000000003 < z Initial program 72.0%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 55.9%
mul-1-neg55.9%
associate-/l*78.0%
distribute-neg-frac78.0%
div-sub78.1%
sub-neg78.1%
*-inverses78.1%
metadata-eval78.1%
Simplified78.1%
Final simplification78.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))))
(if (<= z -3.4e+86)
t_1
(if (<= z -220000.0)
(* (- y z) (/ x t))
(if (or (<= z -3.9e-78) (not (<= z 1.48e-24)))
t_1
(* x (/ y (- t z))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -3.4e+86) {
tmp = t_1;
} else if (z <= -220000.0) {
tmp = (y - z) * (x / t);
} else if ((z <= -3.9e-78) || !(z <= 1.48e-24)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (1.0d0 - (y / z))
if (z <= (-3.4d+86)) then
tmp = t_1
else if (z <= (-220000.0d0)) then
tmp = (y - z) * (x / t)
else if ((z <= (-3.9d-78)) .or. (.not. (z <= 1.48d-24))) then
tmp = t_1
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 t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -3.4e+86) {
tmp = t_1;
} else if (z <= -220000.0) {
tmp = (y - z) * (x / t);
} else if ((z <= -3.9e-78) || !(z <= 1.48e-24)) {
tmp = t_1;
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if z <= -3.4e+86: tmp = t_1 elif z <= -220000.0: tmp = (y - z) * (x / t) elif (z <= -3.9e-78) or not (z <= 1.48e-24): tmp = t_1 else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -3.4e+86) tmp = t_1; elseif (z <= -220000.0) tmp = Float64(Float64(y - z) * Float64(x / t)); elseif ((z <= -3.9e-78) || !(z <= 1.48e-24)) tmp = t_1; else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / z)); tmp = 0.0; if (z <= -3.4e+86) tmp = t_1; elseif (z <= -220000.0) tmp = (y - z) * (x / t); elseif ((z <= -3.9e-78) || ~((z <= 1.48e-24))) tmp = t_1; else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e+86], t$95$1, If[LessEqual[z, -220000.0], N[(N[(y - z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -3.9e-78], N[Not[LessEqual[z, 1.48e-24]], $MachinePrecision]], t$95$1, N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{+86}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -220000:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{-78} \lor \neg \left(z \leq 1.48 \cdot 10^{-24}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -3.3999999999999998e86 or -2.2e5 < z < -3.9000000000000002e-78 or 1.48000000000000003e-24 < z Initial program 78.8%
associate-*r/99.0%
Simplified99.0%
div-sub99.0%
Applied egg-rr99.0%
Taylor expanded in t around 0 74.6%
mul-1-neg74.6%
sub-neg74.6%
Simplified74.6%
if -3.3999999999999998e86 < z < -2.2e5Initial program 74.2%
associate-*r/99.4%
Simplified99.4%
Taylor expanded in t around inf 57.8%
div-inv57.8%
*-commutative57.8%
associate-*l*73.2%
div-inv73.4%
Applied egg-rr73.4%
if -3.9000000000000002e-78 < z < 1.48000000000000003e-24Initial program 89.6%
associate-*r/93.6%
Simplified93.6%
Taylor expanded in y around inf 79.3%
Final simplification76.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))) (t_2 (/ x (/ t (- y z)))))
(if (<= t -1.6e+71)
t_2
(if (<= t 8.5e-125)
t_1
(if (<= t 2.2e-62) (* x (/ y (- t z))) (if (<= t 5e+74) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double t_2 = x / (t / (y - z));
double tmp;
if (t <= -1.6e+71) {
tmp = t_2;
} else if (t <= 8.5e-125) {
tmp = t_1;
} else if (t <= 2.2e-62) {
tmp = x * (y / (t - z));
} else if (t <= 5e+74) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x * (1.0d0 - (y / z))
t_2 = x / (t / (y - z))
if (t <= (-1.6d+71)) then
tmp = t_2
else if (t <= 8.5d-125) then
tmp = t_1
else if (t <= 2.2d-62) then
tmp = x * (y / (t - z))
else if (t <= 5d+74) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double t_2 = x / (t / (y - z));
double tmp;
if (t <= -1.6e+71) {
tmp = t_2;
} else if (t <= 8.5e-125) {
tmp = t_1;
} else if (t <= 2.2e-62) {
tmp = x * (y / (t - z));
} else if (t <= 5e+74) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) t_2 = x / (t / (y - z)) tmp = 0 if t <= -1.6e+71: tmp = t_2 elif t <= 8.5e-125: tmp = t_1 elif t <= 2.2e-62: tmp = x * (y / (t - z)) elif t <= 5e+74: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / z))) t_2 = Float64(x / Float64(t / Float64(y - z))) tmp = 0.0 if (t <= -1.6e+71) tmp = t_2; elseif (t <= 8.5e-125) tmp = t_1; elseif (t <= 2.2e-62) tmp = Float64(x * Float64(y / Float64(t - z))); elseif (t <= 5e+74) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / z)); t_2 = x / (t / (y - z)); tmp = 0.0; if (t <= -1.6e+71) tmp = t_2; elseif (t <= 8.5e-125) tmp = t_1; elseif (t <= 2.2e-62) tmp = x * (y / (t - z)); elseif (t <= 5e+74) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.6e+71], t$95$2, If[LessEqual[t, 8.5e-125], t$95$1, If[LessEqual[t, 2.2e-62], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e+74], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
t_2 := \frac{x}{\frac{t}{y - z}}\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{+71}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-125}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{-62}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+74}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -1.60000000000000012e71 or 4.99999999999999963e74 < t Initial program 76.8%
associate-*r/97.0%
Simplified97.0%
Taylor expanded in t around inf 63.7%
associate-/l*75.4%
Simplified75.4%
if -1.60000000000000012e71 < t < 8.5000000000000002e-125 or 2.20000000000000017e-62 < t < 4.99999999999999963e74Initial program 86.7%
associate-*r/96.4%
Simplified96.4%
div-sub96.5%
Applied egg-rr96.5%
Taylor expanded in t around 0 76.7%
mul-1-neg76.7%
sub-neg76.7%
Simplified76.7%
if 8.5000000000000002e-125 < t < 2.20000000000000017e-62Initial program 92.0%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around inf 91.0%
Final simplification76.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))) (t_2 (/ x (/ t (- y z)))))
(if (<= t -2e+69)
t_2
(if (<= t 8.5e-125)
t_1
(if (<= t 9.5e-67) (/ x (/ (- t z) y)) (if (<= t 2e+73) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double t_2 = x / (t / (y - z));
double tmp;
if (t <= -2e+69) {
tmp = t_2;
} else if (t <= 8.5e-125) {
tmp = t_1;
} else if (t <= 9.5e-67) {
tmp = x / ((t - z) / y);
} else if (t <= 2e+73) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x * (1.0d0 - (y / z))
t_2 = x / (t / (y - z))
if (t <= (-2d+69)) then
tmp = t_2
else if (t <= 8.5d-125) then
tmp = t_1
else if (t <= 9.5d-67) then
tmp = x / ((t - z) / y)
else if (t <= 2d+73) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double t_2 = x / (t / (y - z));
double tmp;
if (t <= -2e+69) {
tmp = t_2;
} else if (t <= 8.5e-125) {
tmp = t_1;
} else if (t <= 9.5e-67) {
tmp = x / ((t - z) / y);
} else if (t <= 2e+73) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) t_2 = x / (t / (y - z)) tmp = 0 if t <= -2e+69: tmp = t_2 elif t <= 8.5e-125: tmp = t_1 elif t <= 9.5e-67: tmp = x / ((t - z) / y) elif t <= 2e+73: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / z))) t_2 = Float64(x / Float64(t / Float64(y - z))) tmp = 0.0 if (t <= -2e+69) tmp = t_2; elseif (t <= 8.5e-125) tmp = t_1; elseif (t <= 9.5e-67) tmp = Float64(x / Float64(Float64(t - z) / y)); elseif (t <= 2e+73) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / z)); t_2 = x / (t / (y - z)); tmp = 0.0; if (t <= -2e+69) tmp = t_2; elseif (t <= 8.5e-125) tmp = t_1; elseif (t <= 9.5e-67) tmp = x / ((t - z) / y); elseif (t <= 2e+73) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2e+69], t$95$2, If[LessEqual[t, 8.5e-125], t$95$1, If[LessEqual[t, 9.5e-67], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+73], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
t_2 := \frac{x}{\frac{t}{y - z}}\\
\mathbf{if}\;t \leq -2 \cdot 10^{+69}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-125}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-67}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+73}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2.0000000000000001e69 or 1.99999999999999997e73 < t Initial program 76.8%
associate-*r/97.0%
Simplified97.0%
Taylor expanded in t around inf 63.7%
associate-/l*75.4%
Simplified75.4%
if -2.0000000000000001e69 < t < 8.5000000000000002e-125 or 9.4999999999999994e-67 < t < 1.99999999999999997e73Initial program 86.7%
associate-*r/96.4%
Simplified96.4%
div-sub96.5%
Applied egg-rr96.5%
Taylor expanded in t around 0 76.7%
mul-1-neg76.7%
sub-neg76.7%
Simplified76.7%
if 8.5000000000000002e-125 < t < 9.4999999999999994e-67Initial program 92.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around inf 91.1%
Final simplification76.8%
(FPCore (x y z t)
:precision binary64
(if (<= z -3.85e+86)
x
(if (<= z -0.085)
(/ (- x) (/ t z))
(if (<= z -4.2e-78) x (if (<= z 6.4e-22) (* x (/ y t)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.85e+86) {
tmp = x;
} else if (z <= -0.085) {
tmp = -x / (t / z);
} else if (z <= -4.2e-78) {
tmp = x;
} else if (z <= 6.4e-22) {
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.85d+86)) then
tmp = x
else if (z <= (-0.085d0)) then
tmp = -x / (t / z)
else if (z <= (-4.2d-78)) then
tmp = x
else if (z <= 6.4d-22) 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.85e+86) {
tmp = x;
} else if (z <= -0.085) {
tmp = -x / (t / z);
} else if (z <= -4.2e-78) {
tmp = x;
} else if (z <= 6.4e-22) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.85e+86: tmp = x elif z <= -0.085: tmp = -x / (t / z) elif z <= -4.2e-78: tmp = x elif z <= 6.4e-22: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.85e+86) tmp = x; elseif (z <= -0.085) tmp = Float64(Float64(-x) / Float64(t / z)); elseif (z <= -4.2e-78) tmp = x; elseif (z <= 6.4e-22) 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.85e+86) tmp = x; elseif (z <= -0.085) tmp = -x / (t / z); elseif (z <= -4.2e-78) tmp = x; elseif (z <= 6.4e-22) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.85e+86], x, If[LessEqual[z, -0.085], N[((-x) / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.2e-78], x, If[LessEqual[z, 6.4e-22], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.85 \cdot 10^{+86}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -0.085:\\
\;\;\;\;\frac{-x}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-78}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-22}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.85000000000000026e86 or -0.0850000000000000061 < z < -4.2000000000000001e-78 or 6.39999999999999975e-22 < z Initial program 78.5%
associate-*r/99.0%
Simplified99.0%
Taylor expanded in z around inf 58.3%
if -3.85000000000000026e86 < z < -0.0850000000000000061Initial program 76.7%
associate-*r/99.4%
Simplified99.4%
Taylor expanded in t around inf 57.0%
Taylor expanded in y around 0 37.9%
mul-1-neg37.9%
associate-/l*50.7%
distribute-neg-frac50.7%
Simplified50.7%
if -4.2000000000000001e-78 < z < 6.39999999999999975e-22Initial program 89.6%
associate-*r/93.6%
Simplified93.6%
Taylor expanded in z around 0 68.4%
Final simplification61.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.2e-100) (not (<= z 1.06e-77))) (* x (- 1.0 (/ y z))) (/ y (/ t x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.2e-100) || !(z <= 1.06e-77)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = y / (t / 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.2d-100)) .or. (.not. (z <= 1.06d-77))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = y / (t / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.2e-100) || !(z <= 1.06e-77)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = y / (t / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.2e-100) or not (z <= 1.06e-77): tmp = x * (1.0 - (y / z)) else: tmp = y / (t / x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.2e-100) || !(z <= 1.06e-77)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(y / Float64(t / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.2e-100) || ~((z <= 1.06e-77))) tmp = x * (1.0 - (y / z)); else tmp = y / (t / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.2e-100], N[Not[LessEqual[z, 1.06e-77]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(t / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-100} \lor \neg \left(z \leq 1.06 \cdot 10^{-77}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{t}{x}}\\
\end{array}
\end{array}
if z < -4.20000000000000019e-100 or 1.05999999999999991e-77 < z Initial program 79.6%
associate-*r/98.6%
Simplified98.6%
div-sub98.6%
Applied egg-rr98.6%
Taylor expanded in t around 0 68.2%
mul-1-neg68.2%
sub-neg68.2%
Simplified68.2%
if -4.20000000000000019e-100 < z < 1.05999999999999991e-77Initial program 89.5%
associate-*r/93.4%
Simplified93.4%
div-sub93.4%
Applied egg-rr93.4%
Taylor expanded in z around 0 67.3%
associate-/l*73.2%
associate-/r/73.2%
Simplified73.2%
*-commutative73.2%
clear-num73.0%
un-div-inv73.7%
Applied egg-rr73.7%
Final simplification70.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.2e-78) (not (<= z 2.32e-23))) (* x (- 1.0 (/ y z))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.2e-78) || !(z <= 2.32e-23)) {
tmp = x * (1.0 - (y / 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 ((z <= (-4.2d-78)) .or. (.not. (z <= 2.32d-23))) then
tmp = x * (1.0d0 - (y / 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 ((z <= -4.2e-78) || !(z <= 2.32e-23)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.2e-78) or not (z <= 2.32e-23): tmp = x * (1.0 - (y / z)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.2e-78) || !(z <= 2.32e-23)) tmp = Float64(x * Float64(1.0 - Float64(y / 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 ((z <= -4.2e-78) || ~((z <= 2.32e-23))) tmp = x * (1.0 - (y / z)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.2e-78], N[Not[LessEqual[z, 2.32e-23]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-78} \lor \neg \left(z \leq 2.32 \cdot 10^{-23}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -4.2000000000000001e-78 or 2.3199999999999999e-23 < z Initial program 78.3%
associate-*r/99.1%
Simplified99.1%
div-sub99.1%
Applied egg-rr99.1%
Taylor expanded in t around 0 69.4%
mul-1-neg69.4%
sub-neg69.4%
Simplified69.4%
if -4.2000000000000001e-78 < z < 2.3199999999999999e-23Initial program 89.6%
associate-*r/93.6%
Simplified93.6%
Taylor expanded in y around inf 79.3%
Final simplification73.4%
(FPCore (x y z t) :precision binary64 (if (<= z -4.2e-78) x (if (<= z 1.55e-24) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.2e-78) {
tmp = x;
} else if (z <= 1.55e-24) {
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.2d-78)) then
tmp = x
else if (z <= 1.55d-24) 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.2e-78) {
tmp = x;
} else if (z <= 1.55e-24) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.2e-78: tmp = x elif z <= 1.55e-24: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.2e-78) tmp = x; elseif (z <= 1.55e-24) 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.2e-78) tmp = x; elseif (z <= 1.55e-24) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.2e-78], x, If[LessEqual[z, 1.55e-24], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-78}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-24}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.2000000000000001e-78 or 1.55e-24 < z Initial program 78.3%
associate-*r/99.1%
Simplified99.1%
Taylor expanded in z around inf 53.6%
if -4.2000000000000001e-78 < z < 1.55e-24Initial program 89.6%
associate-*r/93.6%
Simplified93.6%
Taylor expanded in z around 0 68.4%
Final simplification59.7%
(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.8%
associate-*r/96.8%
Simplified96.8%
Final simplification96.8%
(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.8%
associate-*r/96.8%
Simplified96.8%
Taylor expanded in z around inf 36.0%
Final simplification36.0%
(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 2023312
(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)))