
(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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ (- z t) (/ (- z a) y))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) / ((z - a) / y));
}
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 + ((z - t) / ((z - a) / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) / ((z - a) / y));
}
def code(x, y, z, t, a): return x + ((z - t) / ((z - a) / y))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) / Float64(Float64(z - a) / y))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) / ((z - a) / y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{\frac{z - a}{y}}
\end{array}
Initial program 87.0%
*-commutative87.0%
associate-/l*96.8%
Simplified96.8%
Final simplification96.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- z t) y) (- z a))))
(if (<= t_1 (- INFINITY))
(- x (* t (/ y (- z a))))
(if (<= t_1 2e+287) (+ x t_1) (+ x (* y (- 1.0 (/ t z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) * y) / (z - a);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x - (t * (y / (z - a)));
} else if (t_1 <= 2e+287) {
tmp = x + t_1;
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) * y) / (z - a);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x - (t * (y / (z - a)));
} else if (t_1 <= 2e+287) {
tmp = x + t_1;
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((z - t) * y) / (z - a) tmp = 0 if t_1 <= -math.inf: tmp = x - (t * (y / (z - a))) elif t_1 <= 2e+287: tmp = x + t_1 else: tmp = x + (y * (1.0 - (t / z))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - t) * y) / Float64(z - a)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); elseif (t_1 <= 2e+287) tmp = Float64(x + t_1); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((z - t) * y) / (z - a); tmp = 0.0; if (t_1 <= -Inf) tmp = x - (t * (y / (z - a))); elseif (t_1 <= 2e+287) tmp = x + t_1; else tmp = x + (y * (1.0 - (t / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+287], N[(x + t$95$1), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z - t\right) \cdot y}{z - a}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+287}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0Initial program 44.3%
Taylor expanded in t around inf 48.2%
associate-*r/75.9%
neg-mul-175.9%
distribute-rgt-neg-in75.9%
distribute-neg-frac75.9%
Simplified75.9%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.0000000000000002e287Initial program 99.8%
if 2.0000000000000002e287 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 38.9%
*-commutative38.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 83.2%
Taylor expanded in y around 0 38.4%
*-commutative38.4%
associate-*l/83.2%
div-sub83.2%
*-inverses83.2%
*-commutative83.2%
Simplified83.2%
Final simplification95.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ t (/ (- a z) y)))) (t_2 (+ x (* y (- 1.0 (/ t z))))))
(if (<= z -8.8e+83)
t_2
(if (<= z -2.3e-247)
t_1
(if (<= z 1.7e-171) (+ x (/ y (/ a t))) (if (<= z 6.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t / ((a - z) / y));
double t_2 = x + (y * (1.0 - (t / z)));
double tmp;
if (z <= -8.8e+83) {
tmp = t_2;
} else if (z <= -2.3e-247) {
tmp = t_1;
} else if (z <= 1.7e-171) {
tmp = x + (y / (a / t));
} else if (z <= 6.0) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x + (t / ((a - z) / y))
t_2 = x + (y * (1.0d0 - (t / z)))
if (z <= (-8.8d+83)) then
tmp = t_2
else if (z <= (-2.3d-247)) then
tmp = t_1
else if (z <= 1.7d-171) then
tmp = x + (y / (a / t))
else if (z <= 6.0d0) 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 a) {
double t_1 = x + (t / ((a - z) / y));
double t_2 = x + (y * (1.0 - (t / z)));
double tmp;
if (z <= -8.8e+83) {
tmp = t_2;
} else if (z <= -2.3e-247) {
tmp = t_1;
} else if (z <= 1.7e-171) {
tmp = x + (y / (a / t));
} else if (z <= 6.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t / ((a - z) / y)) t_2 = x + (y * (1.0 - (t / z))) tmp = 0 if z <= -8.8e+83: tmp = t_2 elif z <= -2.3e-247: tmp = t_1 elif z <= 1.7e-171: tmp = x + (y / (a / t)) elif z <= 6.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t / Float64(Float64(a - z) / y))) t_2 = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))) tmp = 0.0 if (z <= -8.8e+83) tmp = t_2; elseif (z <= -2.3e-247) tmp = t_1; elseif (z <= 1.7e-171) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 6.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t / ((a - z) / y)); t_2 = x + (y * (1.0 - (t / z))); tmp = 0.0; if (z <= -8.8e+83) tmp = t_2; elseif (z <= -2.3e-247) tmp = t_1; elseif (z <= 1.7e-171) tmp = x + (y / (a / t)); elseif (z <= 6.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.8e+83], t$95$2, If[LessEqual[z, -2.3e-247], t$95$1, If[LessEqual[z, 1.7e-171], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{t}{\frac{a - z}{y}}\\
t_2 := x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{if}\;z \leq -8.8 \cdot 10^{+83}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-247}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-171}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 6:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -8.79999999999999995e83 or 6 < z Initial program 77.3%
*-commutative77.3%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in z around inf 88.8%
Taylor expanded in y around 0 72.5%
*-commutative72.5%
associate-*l/91.3%
div-sub91.3%
*-inverses91.3%
*-commutative91.3%
Simplified91.3%
if -8.79999999999999995e83 < z < -2.3e-247 or 1.69999999999999993e-171 < z < 6Initial program 95.2%
*-commutative95.2%
associate-/l*99.6%
frac-2neg99.6%
div-inv99.5%
distribute-neg-frac99.5%
Applied egg-rr99.5%
Taylor expanded in t around inf 85.1%
associate-/l*89.5%
Simplified89.5%
if -2.3e-247 < z < 1.69999999999999993e-171Initial program 97.1%
Taylor expanded in z around 0 96.4%
+-commutative96.4%
associate-/l*86.3%
Simplified86.3%
associate-/r/99.0%
Applied egg-rr99.0%
*-commutative99.0%
clear-num99.0%
un-div-inv99.1%
Applied egg-rr99.1%
Final simplification91.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.55e-75) (not (<= z 3.7e-6))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.55e-75) || !(z <= 3.7e-6)) {
tmp = x + (y * (1.0 - (t / z)));
} 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 <= (-3.55d-75)) .or. (.not. (z <= 3.7d-6))) then
tmp = x + (y * (1.0d0 - (t / z)))
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 <= -3.55e-75) || !(z <= 3.7e-6)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.55e-75) or not (z <= 3.7e-6): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.55e-75) || !(z <= 3.7e-6)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); 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 <= -3.55e-75) || ~((z <= 3.7e-6))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.55e-75], N[Not[LessEqual[z, 3.7e-6]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.55 \cdot 10^{-75} \lor \neg \left(z \leq 3.7 \cdot 10^{-6}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3.5500000000000002e-75 or 3.7000000000000002e-6 < z Initial program 80.3%
*-commutative80.3%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in z around inf 86.2%
Taylor expanded in y around 0 72.9%
*-commutative72.9%
associate-*l/88.2%
div-sub88.2%
*-inverses88.2%
*-commutative88.2%
Simplified88.2%
if -3.5500000000000002e-75 < z < 3.7000000000000002e-6Initial program 97.0%
Taylor expanded in z around 0 88.0%
+-commutative88.0%
associate-/l*85.0%
Simplified85.0%
associate-/r/90.3%
Applied egg-rr90.3%
Final simplification89.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e+15) (not (<= t 3.1e-6))) (+ x (/ t (/ (- a z) y))) (+ x (/ y (/ (- z a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+15) || !(t <= 3.1e-6)) {
tmp = x + (t / ((a - z) / 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 <= (-1.05d+15)) .or. (.not. (t <= 3.1d-6))) then
tmp = x + (t / ((a - z) / 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 <= -1.05e+15) || !(t <= 3.1e-6)) {
tmp = x + (t / ((a - z) / y));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e+15) or not (t <= 3.1e-6): tmp = x + (t / ((a - z) / y)) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.05e+15) || !(t <= 3.1e-6)) tmp = Float64(x + Float64(t / Float64(Float64(a - z) / 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 <= -1.05e+15) || ~((t <= 3.1e-6))) tmp = x + (t / ((a - z) / y)); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.05e+15], N[Not[LessEqual[t, 3.1e-6]], $MachinePrecision]], N[(x + N[(t / N[(N[(a - z), $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 -1.05 \cdot 10^{+15} \lor \neg \left(t \leq 3.1 \cdot 10^{-6}\right):\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if t < -1.05e15 or 3.1e-6 < t Initial program 85.5%
*-commutative85.5%
associate-/l*98.2%
frac-2neg98.2%
div-inv98.1%
distribute-neg-frac98.1%
Applied egg-rr98.1%
Taylor expanded in t around inf 83.2%
associate-/l*91.8%
Simplified91.8%
if -1.05e15 < t < 3.1e-6Initial program 88.8%
Taylor expanded in t around 0 79.5%
associate-/l*90.7%
Simplified90.7%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.9e+15) (+ x (/ t (/ (- a z) y))) (if (<= t 3.1e-9) (+ x (/ y (/ (- z a) z))) (- x (* t (/ y (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.9e+15) {
tmp = x + (t / ((a - z) / y));
} else if (t <= 3.1e-9) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x - (t * (y / (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 (t <= (-3.9d+15)) then
tmp = x + (t / ((a - z) / y))
else if (t <= 3.1d-9) then
tmp = x + (y / ((z - a) / z))
else
tmp = x - (t * (y / (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 (t <= -3.9e+15) {
tmp = x + (t / ((a - z) / y));
} else if (t <= 3.1e-9) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x - (t * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.9e+15: tmp = x + (t / ((a - z) / y)) elif t <= 3.1e-9: tmp = x + (y / ((z - a) / z)) else: tmp = x - (t * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.9e+15) tmp = Float64(x + Float64(t / Float64(Float64(a - z) / y))); elseif (t <= 3.1e-9) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); else tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.9e+15) tmp = x + (t / ((a - z) / y)); elseif (t <= 3.1e-9) tmp = x + (y / ((z - a) / z)); else tmp = x - (t * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.9e+15], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.1e-9], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.9 \cdot 10^{+15}:\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-9}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if t < -3.9e15Initial program 86.1%
*-commutative86.1%
associate-/l*97.7%
frac-2neg97.7%
div-inv97.6%
distribute-neg-frac97.6%
Applied egg-rr97.6%
Taylor expanded in t around inf 80.4%
associate-/l*91.1%
Simplified91.1%
if -3.9e15 < t < 3.10000000000000005e-9Initial program 88.8%
Taylor expanded in t around 0 79.5%
associate-/l*90.7%
Simplified90.7%
if 3.10000000000000005e-9 < t Initial program 84.6%
Taylor expanded in t around inf 87.2%
associate-*r/92.8%
neg-mul-192.8%
distribute-rgt-neg-in92.8%
distribute-neg-frac92.8%
Simplified92.8%
Final simplification91.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.8e+83) (not (<= z 0.00195))) (+ x y) (+ x (/ (* t y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.8e+83) || !(z <= 0.00195)) {
tmp = x + y;
} else {
tmp = x + ((t * y) / 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 <= (-8.8d+83)) .or. (.not. (z <= 0.00195d0))) then
tmp = x + y
else
tmp = x + ((t * y) / 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 <= -8.8e+83) || !(z <= 0.00195)) {
tmp = x + y;
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.8e+83) or not (z <= 0.00195): tmp = x + y else: tmp = x + ((t * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.8e+83) || !(z <= 0.00195)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(t * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.8e+83) || ~((z <= 0.00195))) tmp = x + y; else tmp = x + ((t * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.8e+83], N[Not[LessEqual[z, 0.00195]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+83} \lor \neg \left(z \leq 0.00195\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\end{array}
\end{array}
if z < -8.79999999999999995e83 or 0.0019499999999999999 < z Initial program 77.3%
Taylor expanded in z around inf 80.9%
+-commutative80.9%
Simplified80.9%
if -8.79999999999999995e83 < z < 0.0019499999999999999Initial program 95.7%
Taylor expanded in z around 0 81.8%
Final simplification81.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.8e+83) (not (<= z 2.2))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.8e+83) || !(z <= 2.2)) {
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 <= (-8.8d+83)) .or. (.not. (z <= 2.2d0))) 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 <= -8.8e+83) || !(z <= 2.2)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.8e+83) or not (z <= 2.2): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.8e+83) || !(z <= 2.2)) 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 <= -8.8e+83) || ~((z <= 2.2))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.8e+83], N[Not[LessEqual[z, 2.2]], $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 -8.8 \cdot 10^{+83} \lor \neg \left(z \leq 2.2\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -8.79999999999999995e83 or 2.2000000000000002 < z Initial program 77.3%
Taylor expanded in z around inf 80.9%
+-commutative80.9%
Simplified80.9%
if -8.79999999999999995e83 < z < 2.2000000000000002Initial program 95.7%
Taylor expanded in z around 0 81.8%
+-commutative81.8%
associate-/l*80.9%
Simplified80.9%
associate-/r/84.1%
Applied egg-rr84.1%
Final simplification82.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.8e+83) (not (<= z 1.32e-5))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.8e+83) || !(z <= 1.32e-5)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
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 <= (-8.8d+83)) .or. (.not. (z <= 1.32d-5))) then
tmp = x + y
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.8e+83) || !(z <= 1.32e-5)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.8e+83) or not (z <= 1.32e-5): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.8e+83) || !(z <= 1.32e-5)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.8e+83) || ~((z <= 1.32e-5))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.8e+83], N[Not[LessEqual[z, 1.32e-5]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+83} \lor \neg \left(z \leq 1.32 \cdot 10^{-5}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -8.79999999999999995e83 or 1.32000000000000007e-5 < z Initial program 77.3%
Taylor expanded in z around inf 80.9%
+-commutative80.9%
Simplified80.9%
if -8.79999999999999995e83 < z < 1.32000000000000007e-5Initial program 95.7%
Taylor expanded in z around 0 81.8%
+-commutative81.8%
associate-/l*80.9%
Simplified80.9%
associate-/r/84.1%
Applied egg-rr84.1%
*-commutative84.1%
clear-num83.9%
un-div-inv84.6%
Applied egg-rr84.6%
Final simplification82.8%
(FPCore (x y z t a) :precision binary64 (if (<= a 2.2e+91) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 2.2e+91) {
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.2d+91) 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.2e+91) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 2.2e+91: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 2.2e+91) 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.2e+91) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 2.2e+91], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.2 \cdot 10^{+91}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 2.19999999999999999e91Initial program 88.2%
Taylor expanded in z around inf 64.3%
+-commutative64.3%
Simplified64.3%
if 2.19999999999999999e91 < a Initial program 78.6%
Taylor expanded in x around inf 67.7%
Final simplification64.7%
(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 87.0%
Taylor expanded in x around inf 56.7%
Final simplification56.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 2024010
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))