
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 99.1%
Final simplification99.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (/ t z)))))
(if (<= z -9.5e+41)
(+ x y)
(if (<= z -1.25e-24)
t_1
(if (<= z 1.05e-127)
(+ x (* y (/ t a)))
(if (or (<= z 1.6e-14) (not (<= z 2.3e+45))) (+ x y) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * (t / z));
double tmp;
if (z <= -9.5e+41) {
tmp = x + y;
} else if (z <= -1.25e-24) {
tmp = t_1;
} else if (z <= 1.05e-127) {
tmp = x + (y * (t / a));
} else if ((z <= 1.6e-14) || !(z <= 2.3e+45)) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x - (y * (t / z))
if (z <= (-9.5d+41)) then
tmp = x + y
else if (z <= (-1.25d-24)) then
tmp = t_1
else if (z <= 1.05d-127) then
tmp = x + (y * (t / a))
else if ((z <= 1.6d-14) .or. (.not. (z <= 2.3d+45))) then
tmp = x + y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * (t / z));
double tmp;
if (z <= -9.5e+41) {
tmp = x + y;
} else if (z <= -1.25e-24) {
tmp = t_1;
} else if (z <= 1.05e-127) {
tmp = x + (y * (t / a));
} else if ((z <= 1.6e-14) || !(z <= 2.3e+45)) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * (t / z)) tmp = 0 if z <= -9.5e+41: tmp = x + y elif z <= -1.25e-24: tmp = t_1 elif z <= 1.05e-127: tmp = x + (y * (t / a)) elif (z <= 1.6e-14) or not (z <= 2.3e+45): tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(t / z))) tmp = 0.0 if (z <= -9.5e+41) tmp = Float64(x + y); elseif (z <= -1.25e-24) tmp = t_1; elseif (z <= 1.05e-127) tmp = Float64(x + Float64(y * Float64(t / a))); elseif ((z <= 1.6e-14) || !(z <= 2.3e+45)) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * (t / z)); tmp = 0.0; if (z <= -9.5e+41) tmp = x + y; elseif (z <= -1.25e-24) tmp = t_1; elseif (z <= 1.05e-127) tmp = x + (y * (t / a)); elseif ((z <= 1.6e-14) || ~((z <= 2.3e+45))) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.5e+41], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.25e-24], t$95$1, If[LessEqual[z, 1.05e-127], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.6e-14], N[Not[LessEqual[z, 2.3e+45]], $MachinePrecision]], N[(x + y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{t}{z}\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+41}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-127}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-14} \lor \neg \left(z \leq 2.3 \cdot 10^{+45}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -9.4999999999999996e41 or 1.05000000000000005e-127 < z < 1.6000000000000001e-14 or 2.30000000000000012e45 < z Initial program 99.2%
Taylor expanded in z around inf 79.0%
if -9.4999999999999996e41 < z < -1.24999999999999995e-24 or 1.6000000000000001e-14 < z < 2.30000000000000012e45Initial program 99.8%
Taylor expanded in t around inf 90.5%
neg-mul-190.5%
distribute-neg-frac90.5%
Simplified90.5%
Taylor expanded in z around inf 85.4%
associate-*r/85.4%
neg-mul-185.4%
Simplified85.4%
if -1.24999999999999995e-24 < z < 1.05000000000000005e-127Initial program 98.9%
Taylor expanded in z around 0 83.5%
Final simplification81.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -1.5e+37)
t_1
(if (<= z -7.2e-26)
(- x (* t (/ y z)))
(if (<= z 5.5e-196) (+ x (/ y (/ a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -1.5e+37) {
tmp = t_1;
} else if (z <= -7.2e-26) {
tmp = x - (t * (y / z));
} else if (z <= 5.5e-196) {
tmp = x + (y / (a / t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y * (z / (z - a)))
if (z <= (-1.5d+37)) then
tmp = t_1
else if (z <= (-7.2d-26)) then
tmp = x - (t * (y / z))
else if (z <= 5.5d-196) then
tmp = x + (y / (a / t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -1.5e+37) {
tmp = t_1;
} else if (z <= -7.2e-26) {
tmp = x - (t * (y / z));
} else if (z <= 5.5e-196) {
tmp = x + (y / (a / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -1.5e+37: tmp = t_1 elif z <= -7.2e-26: tmp = x - (t * (y / z)) elif z <= 5.5e-196: tmp = x + (y / (a / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -1.5e+37) tmp = t_1; elseif (z <= -7.2e-26) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 5.5e-196) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (z / (z - a))); tmp = 0.0; if (z <= -1.5e+37) tmp = t_1; elseif (z <= -7.2e-26) tmp = x - (t * (y / z)); elseif (z <= 5.5e-196) tmp = x + (y / (a / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e+37], t$95$1, If[LessEqual[z, -7.2e-26], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e-196], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-26}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-196}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.50000000000000011e37 or 5.50000000000000014e-196 < z Initial program 99.2%
Taylor expanded in t around 0 85.0%
if -1.50000000000000011e37 < z < -7.2000000000000003e-26Initial program 99.9%
associate-*r/99.7%
Simplified99.7%
associate-/l*99.9%
associate-/r/99.7%
Applied egg-rr99.7%
Taylor expanded in t around inf 98.9%
mul-1-neg98.9%
associate-/l*98.9%
distribute-neg-frac98.9%
Simplified98.9%
Taylor expanded in z around inf 97.9%
mul-1-neg97.9%
associate-*r/97.9%
*-commutative97.9%
distribute-rgt-neg-in97.9%
Simplified97.9%
if -7.2000000000000003e-26 < z < 5.50000000000000014e-196Initial program 98.8%
Taylor expanded in z around 0 87.0%
clear-num87.0%
un-div-inv87.1%
Applied egg-rr87.1%
Final simplification86.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.6e+39)
(+ x (/ y (/ (- z a) z)))
(if (<= z -6.2e-26)
(- x (* t (/ y z)))
(if (<= z 5.5e-196) (+ x (/ y (/ a t))) (+ x (* y (/ z (- z a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e+39) {
tmp = x + (y / ((z - a) / z));
} else if (z <= -6.2e-26) {
tmp = x - (t * (y / z));
} else if (z <= 5.5e-196) {
tmp = x + (y / (a / t));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.6d+39)) then
tmp = x + (y / ((z - a) / z))
else if (z <= (-6.2d-26)) then
tmp = x - (t * (y / z))
else if (z <= 5.5d-196) then
tmp = x + (y / (a / t))
else
tmp = x + (y * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e+39) {
tmp = x + (y / ((z - a) / z));
} else if (z <= -6.2e-26) {
tmp = x - (t * (y / z));
} else if (z <= 5.5e-196) {
tmp = x + (y / (a / t));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.6e+39: tmp = x + (y / ((z - a) / z)) elif z <= -6.2e-26: tmp = x - (t * (y / z)) elif z <= 5.5e-196: tmp = x + (y / (a / t)) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.6e+39) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); elseif (z <= -6.2e-26) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 5.5e-196) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.6e+39) tmp = x + (y / ((z - a) / z)); elseif (z <= -6.2e-26) tmp = x - (t * (y / z)); elseif (z <= 5.5e-196) tmp = x + (y / (a / t)); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.6e+39], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.2e-26], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e-196], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+39}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-26}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-196}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -2.6e39Initial program 99.9%
Taylor expanded in t around 0 87.4%
associate-/l*93.7%
Simplified93.7%
if -2.6e39 < z < -6.19999999999999966e-26Initial program 99.9%
associate-*r/99.7%
Simplified99.7%
associate-/l*99.9%
associate-/r/99.7%
Applied egg-rr99.7%
Taylor expanded in t around inf 98.9%
mul-1-neg98.9%
associate-/l*98.9%
distribute-neg-frac98.9%
Simplified98.9%
Taylor expanded in z around inf 97.9%
mul-1-neg97.9%
associate-*r/97.9%
*-commutative97.9%
distribute-rgt-neg-in97.9%
Simplified97.9%
if -6.19999999999999966e-26 < z < 5.50000000000000014e-196Initial program 98.8%
Taylor expanded in z around 0 87.0%
clear-num87.0%
un-div-inv87.1%
Applied egg-rr87.1%
if 5.50000000000000014e-196 < z Initial program 98.9%
Taylor expanded in t around 0 80.1%
Final simplification86.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.5e+40)
(+ x y)
(if (<= z -3.9e-24)
(- x (* t (/ y z)))
(if (<= z 1.05e-127) (+ x (* y (/ t a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.5e+40) {
tmp = x + y;
} else if (z <= -3.9e-24) {
tmp = x - (t * (y / z));
} else if (z <= 1.05e-127) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.5d+40)) then
tmp = x + y
else if (z <= (-3.9d-24)) then
tmp = x - (t * (y / z))
else if (z <= 1.05d-127) then
tmp = x + (y * (t / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.5e+40) {
tmp = x + y;
} else if (z <= -3.9e-24) {
tmp = x - (t * (y / z));
} else if (z <= 1.05e-127) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.5e+40: tmp = x + y elif z <= -3.9e-24: tmp = x - (t * (y / z)) elif z <= 1.05e-127: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.5e+40) tmp = Float64(x + y); elseif (z <= -3.9e-24) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 1.05e-127) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.5e+40) tmp = x + y; elseif (z <= -3.9e-24) tmp = x - (t * (y / z)); elseif (z <= 1.05e-127) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.5e+40], N[(x + y), $MachinePrecision], If[LessEqual[z, -3.9e-24], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-127], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+40}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{-24}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-127}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.5000000000000001e40 or 1.05000000000000005e-127 < z Initial program 99.2%
Taylor expanded in z around inf 75.3%
if -1.5000000000000001e40 < z < -3.9e-24Initial program 99.9%
associate-*r/99.7%
Simplified99.7%
associate-/l*99.9%
associate-/r/99.7%
Applied egg-rr99.7%
Taylor expanded in t around inf 98.9%
mul-1-neg98.9%
associate-/l*98.9%
distribute-neg-frac98.9%
Simplified98.9%
Taylor expanded in z around inf 97.9%
mul-1-neg97.9%
associate-*r/97.9%
*-commutative97.9%
distribute-rgt-neg-in97.9%
Simplified97.9%
if -3.9e-24 < z < 1.05000000000000005e-127Initial program 98.9%
Taylor expanded in z around 0 83.5%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2e-67) (not (<= t 4.6e+86))) (- x (* y (/ t (- z a)))) (+ x (/ y (/ (- z a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2e-67) || !(t <= 4.6e+86)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2d-67)) .or. (.not. (t <= 4.6d+86))) then
tmp = x - (y * (t / (z - a)))
else
tmp = x + (y / ((z - a) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2e-67) || !(t <= 4.6e+86)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2e-67) or not (t <= 4.6e+86): tmp = x - (y * (t / (z - a))) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2e-67) || !(t <= 4.6e+86)) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2e-67) || ~((t <= 4.6e+86))) tmp = x - (y * (t / (z - a))); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2e-67], N[Not[LessEqual[t, 4.6e+86]], $MachinePrecision]], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-67} \lor \neg \left(t \leq 4.6 \cdot 10^{+86}\right):\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if t < -1.99999999999999989e-67 or 4.59999999999999979e86 < t Initial program 98.1%
Taylor expanded in t around inf 89.1%
neg-mul-189.1%
distribute-neg-frac89.1%
Simplified89.1%
if -1.99999999999999989e-67 < t < 4.59999999999999979e86Initial program 99.9%
Taylor expanded in t around 0 79.1%
associate-/l*90.8%
Simplified90.8%
Final simplification90.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.5e-68) (not (<= t 6.2e+86))) (- x (/ t (/ (- z a) y))) (+ x (/ y (/ (- z a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.5e-68) || !(t <= 6.2e+86)) {
tmp = x - (t / ((z - a) / y));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.5d-68)) .or. (.not. (t <= 6.2d+86))) then
tmp = x - (t / ((z - a) / y))
else
tmp = x + (y / ((z - a) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.5e-68) || !(t <= 6.2e+86)) {
tmp = x - (t / ((z - a) / y));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.5e-68) or not (t <= 6.2e+86): tmp = x - (t / ((z - a) / y)) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.5e-68) || !(t <= 6.2e+86)) tmp = Float64(x - Float64(t / Float64(Float64(z - a) / y))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.5e-68) || ~((t <= 6.2e+86))) tmp = x - (t / ((z - a) / y)); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.5e-68], N[Not[LessEqual[t, 6.2e+86]], $MachinePrecision]], N[(x - N[(t / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{-68} \lor \neg \left(t \leq 6.2 \cdot 10^{+86}\right):\\
\;\;\;\;x - \frac{t}{\frac{z - a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if t < -2.49999999999999986e-68 or 6.2000000000000004e86 < t Initial program 98.1%
associate-*r/84.7%
Simplified84.7%
associate-/l*98.1%
associate-/r/98.9%
Applied egg-rr98.9%
Taylor expanded in t around inf 81.7%
mul-1-neg81.7%
associate-/l*90.9%
distribute-neg-frac90.9%
Simplified90.9%
if -2.49999999999999986e-68 < t < 6.2000000000000004e86Initial program 99.9%
Taylor expanded in t around 0 79.1%
associate-/l*90.8%
Simplified90.8%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3e-13) (not (<= z 1.05e-127))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3e-13) || !(z <= 1.05e-127)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3d-13)) .or. (.not. (z <= 1.05d-127))) then
tmp = x + y
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3e-13) || !(z <= 1.05e-127)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3e-13) or not (z <= 1.05e-127): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3e-13) || !(z <= 1.05e-127)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3e-13) || ~((z <= 1.05e-127))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3e-13], N[Not[LessEqual[z, 1.05e-127]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-13} \lor \neg \left(z \leq 1.05 \cdot 10^{-127}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.99999999999999984e-13 or 1.05000000000000005e-127 < z Initial program 99.2%
Taylor expanded in z around inf 73.7%
if -2.99999999999999984e-13 < z < 1.05000000000000005e-127Initial program 98.9%
Taylor expanded in z around 0 81.5%
Final simplification77.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.85e+44) x (if (<= a 1.1e+33) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.85e+44) {
tmp = x;
} else if (a <= 1.1e+33) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-2.85d+44)) then
tmp = x
else if (a <= 1.1d+33) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.85e+44) {
tmp = x;
} else if (a <= 1.1e+33) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.85e+44: tmp = x elif a <= 1.1e+33: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.85e+44) tmp = x; elseif (a <= 1.1e+33) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.85e+44) tmp = x; elseif (a <= 1.1e+33) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.85e+44], x, If[LessEqual[a, 1.1e+33], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.85 \cdot 10^{+44}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{+33}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.8500000000000001e44 or 1.09999999999999997e33 < a Initial program 99.8%
Taylor expanded in z around 0 82.6%
Taylor expanded in x around inf 65.3%
if -2.8500000000000001e44 < a < 1.09999999999999997e33Initial program 98.6%
Taylor expanded in z around inf 62.5%
Final simplification63.6%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.1%
Taylor expanded in z around 0 60.4%
Taylor expanded in x around inf 50.7%
Final simplification50.7%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024020
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))