
(FPCore (x y) :precision binary64 :pre TRUE (exp (* (* x y) y)))
double code(double x, double y) {
return exp(((x * y) * y));
}
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = exp(((x * y) * y))
end function
public static double code(double x, double y) {
return Math.exp(((x * y) * y));
}
def code(x, y): return math.exp(((x * y) * y))
function code(x, y) return exp(Float64(Float64(x * y) * y)) end
function tmp = code(x, y) tmp = exp(((x * y) * y)); end
code[x_, y_] := N[Exp[N[(N[(x * y), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision]
f(x, y): x in [-inf, +inf], y in [-inf, +inf] code: THEORY BEGIN f(x, y: real): real = exp(((x * y) * y)) END code
e^{\left(x \cdot y\right) \cdot y}
Herbie found 3 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 :pre TRUE (exp (* (* x y) y)))
double code(double x, double y) {
return exp(((x * y) * y));
}
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = exp(((x * y) * y))
end function
public static double code(double x, double y) {
return Math.exp(((x * y) * y));
}
def code(x, y): return math.exp(((x * y) * y))
function code(x, y) return exp(Float64(Float64(x * y) * y)) end
function tmp = code(x, y) tmp = exp(((x * y) * y)); end
code[x_, y_] := N[Exp[N[(N[(x * y), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision]
f(x, y): x in [-inf, +inf], y in [-inf, +inf] code: THEORY BEGIN f(x, y: real): real = exp(((x * y) * y)) END code
e^{\left(x \cdot y\right) \cdot y}
(FPCore (x y) :precision binary64 :pre TRUE (if (<= (* (* x y) y) -143750390.52798983) 0.0 1.0))
double code(double x, double y) {
double tmp;
if (((x * y) * y) <= -143750390.52798983) {
tmp = 0.0;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (((x * y) * y) <= (-143750390.52798983d0)) then
tmp = 0.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (((x * y) * y) <= -143750390.52798983) {
tmp = 0.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if ((x * y) * y) <= -143750390.52798983: tmp = 0.0 else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (Float64(Float64(x * y) * y) <= -143750390.52798983) tmp = 0.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (((x * y) * y) <= -143750390.52798983) tmp = 0.0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(N[(x * y), $MachinePrecision] * y), $MachinePrecision], -143750390.52798983], 0.0, 1.0]
f(x, y): x in [-inf, +inf], y in [-inf, +inf] code: THEORY BEGIN f(x, y: real): real = LET tmp = IF (((x * y) * y) <= (-1437503905279898345470428466796875e-25)) THEN (0) ELSE (1) ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;\left(x \cdot y\right) \cdot y \leq -143750390.52798983:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
if (*.f64 (*.f64 x y) y) < -143750390.52798983Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites51.4%
Taylor expanded in undef-var around zero
Applied rewrites27.1%
if -143750390.52798983 < (*.f64 (*.f64 x y) y) Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites51.4%
(FPCore (x y) :precision binary64 :pre TRUE 1.0)
double code(double x, double y) {
return 1.0;
}
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
f(x, y): x in [-inf, +inf], y in [-inf, +inf] code: THEORY BEGIN f(x, y: real): real = 1 END code
1
Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites51.4%
herbie shell --seed 2026092
(FPCore (x y)
:name "Data.Random.Distribution.Normal:normalF from random-fu-0.2.6.2"
:precision binary64
(exp (* (* x y) y)))